Commit e1940fa4 authored by Ben Goz's avatar Ben Goz Committed by Oded Gabbay

drm/amdkfd: fix runlist length calculation

The MAP_QUEUES packet length for Carrizo is different than for Kaveri.
Therefore, we now need to calculate the runlist length with regard to the
underlying H/W.
Signed-off-by: default avatarBen Goz <ben.goz@amd.com>
Signed-off-by: default avatarOded Gabbay <oded.gabbay@gmail.com>
parent 914bea63
...@@ -27,6 +27,7 @@ ...@@ -27,6 +27,7 @@
#include "kfd_kernel_queue.h" #include "kfd_kernel_queue.h"
#include "kfd_priv.h" #include "kfd_priv.h"
#include "kfd_pm4_headers.h" #include "kfd_pm4_headers.h"
#include "kfd_pm4_headers_vi.h"
#include "kfd_pm4_opcodes.h" #include "kfd_pm4_opcodes.h"
static inline void inc_wptr(unsigned int *wptr, unsigned int increment_bytes, static inline void inc_wptr(unsigned int *wptr, unsigned int increment_bytes,
...@@ -55,6 +56,7 @@ static void pm_calc_rlib_size(struct packet_manager *pm, ...@@ -55,6 +56,7 @@ static void pm_calc_rlib_size(struct packet_manager *pm,
bool *over_subscription) bool *over_subscription)
{ {
unsigned int process_count, queue_count; unsigned int process_count, queue_count;
unsigned int map_queue_size;
BUG_ON(!pm || !rlib_size || !over_subscription); BUG_ON(!pm || !rlib_size || !over_subscription);
...@@ -69,9 +71,13 @@ static void pm_calc_rlib_size(struct packet_manager *pm, ...@@ -69,9 +71,13 @@ static void pm_calc_rlib_size(struct packet_manager *pm,
pr_debug("kfd: over subscribed runlist\n"); pr_debug("kfd: over subscribed runlist\n");
} }
map_queue_size =
(pm->dqm->dev->device_info->asic_family == CHIP_CARRIZO) ?
sizeof(struct pm4_mes_map_queues) :
sizeof(struct pm4_map_queues);
/* calculate run list ib allocation size */ /* calculate run list ib allocation size */
*rlib_size = process_count * sizeof(struct pm4_map_process) + *rlib_size = process_count * sizeof(struct pm4_map_process) +
queue_count * sizeof(struct pm4_map_queues); queue_count * map_queue_size;
/* /*
* Increase the allocation size in case we need a chained run list * Increase the allocation size in case we need a chained run list
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment