mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-24 15:20:10 +01:00
lima: Fix lima_screen_query_dmabuf_modifiers()
Incorrect implementation has been found during code surfing. v3d implementation used for reference. Signed-off-by: Roman Stratiienko <r.stratiienko@gmail.com> Reviewed-by: Icenowy Zheng <icenowy@aosc.io> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6076>
This commit is contained in:
parent
ee2c58dde4
commit
9a9b35a3bb
1 changed files with 5 additions and 2 deletions
|
|
@ -440,15 +440,18 @@ lima_screen_query_dmabuf_modifiers(struct pipe_screen *pscreen,
|
|||
DRM_FORMAT_MOD_LINEAR,
|
||||
};
|
||||
|
||||
int num_modifiers = ARRAY_SIZE(available_modifiers);
|
||||
|
||||
if (!modifiers) {
|
||||
*count = ARRAY_SIZE(available_modifiers);
|
||||
*count = num_modifiers;
|
||||
return;
|
||||
}
|
||||
|
||||
*count = MIN2(max, num_modifiers);
|
||||
for (int i = 0; i < *count; i++) {
|
||||
modifiers[i] = available_modifiers[i];
|
||||
if (external_only)
|
||||
external_only = false;
|
||||
external_only[i] = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue