mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-23 17:40:11 +01:00
zink: fix dmabuf plane returns
use the actual drm format plane count, not the resource format cc: mesa-stable Reviewed-by: Dave Airlie <airlied@redhat.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16226>
This commit is contained in:
parent
93144175fa
commit
c025cb9ee9
2 changed files with 6 additions and 2 deletions
|
|
@ -1052,7 +1052,7 @@ zink_resource_get_param(struct pipe_screen *pscreen, struct pipe_context *pctx,
|
||||||
switch (param) {
|
switch (param) {
|
||||||
case PIPE_RESOURCE_PARAM_NPLANES:
|
case PIPE_RESOURCE_PARAM_NPLANES:
|
||||||
if (screen->info.have_EXT_image_drm_format_modifier)
|
if (screen->info.have_EXT_image_drm_format_modifier)
|
||||||
*value = pscreen->get_dmabuf_modifier_planes(pscreen, obj->modifier, pres->format);
|
*value = util_format_get_num_planes(res->drm_format);
|
||||||
else
|
else
|
||||||
*value = 1;
|
*value = 1;
|
||||||
break;
|
break;
|
||||||
|
|
@ -1200,7 +1200,10 @@ zink_resource_from_handle(struct pipe_screen *pscreen,
|
||||||
modifier = whandle->modifier;
|
modifier = whandle->modifier;
|
||||||
modifier_count = 1;
|
modifier_count = 1;
|
||||||
}
|
}
|
||||||
return resource_create(pscreen, &templ2, whandle, usage, &modifier, modifier_count, NULL);
|
struct pipe_resource *pres = resource_create(pscreen, &templ2, whandle, usage, &modifier, modifier_count, NULL);
|
||||||
|
if (pres)
|
||||||
|
zink_resource(pres)->drm_format = whandle->format;
|
||||||
|
return pres;
|
||||||
#else
|
#else
|
||||||
return NULL;
|
return NULL;
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -158,6 +158,7 @@ struct zink_resource {
|
||||||
|
|
||||||
uint8_t modifiers_count;
|
uint8_t modifiers_count;
|
||||||
uint64_t *modifiers;
|
uint64_t *modifiers;
|
||||||
|
enum pipe_format drm_format;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct zink_transfer {
|
struct zink_transfer {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue