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:
parent
53fe6f1084
commit
69edfcaa20
|
@ -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];
|
||||
|
|
|
@ -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];
|
||||
|
|
Loading…
Reference in New Issue