freedreno/drm: Fix bos_on_stack calculation

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16263>
This commit is contained in:
Rob Clark 2022-04-30 10:24:08 -07:00 committed by Marge Bot
parent 53fe6f1084
commit 69edfcaa20
2 changed files with 2 additions and 2 deletions

View File

@ -120,7 +120,7 @@ flush_submit_list(struct list_head *submit_list)
* NOTE allocate on-stack in the common case, but with an upper-
* bound to limit on-stack allocation to 4k:
*/
const unsigned bo_limit = sizeof(struct drm_msm_gem_submit_bo) / 4096;
const unsigned bo_limit = 4096 / sizeof(struct drm_msm_gem_submit_bo);
bool bos_on_stack = fd_submit->nr_bos < bo_limit;
struct drm_msm_gem_submit_bo
_submit_bos[bos_on_stack ? fd_submit->nr_bos : 0];

View File

@ -121,7 +121,7 @@ flush_submit_list(struct list_head *submit_list)
* NOTE allocate on-stack in the common case, but with an upper-
* bound to limit on-stack allocation to 4k:
*/
const unsigned bo_limit = sizeof(struct drm_msm_gem_submit_bo) / 4096;
const unsigned bo_limit = 4096 / sizeof(struct drm_msm_gem_submit_bo);
bool bos_on_stack = fd_submit->nr_bos < bo_limit;
struct drm_msm_gem_submit_bo
_submit_bos[bos_on_stack ? fd_submit->nr_bos : 0];