mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-08 06:58:05 +02:00
gallium: Store the image format in winsys_handle
This format will be used to properly handle planar images with modifiers in iris. Fixes:246eebba4a("iris: Export and import surfaces with modifiers that have aux data") Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> (cherry picked from commit51ee8fff9b)
This commit is contained in:
parent
96b8f42611
commit
f3507690f8
2 changed files with 10 additions and 0 deletions
|
|
@ -49,6 +49,12 @@ struct winsys_handle
|
|||
*/
|
||||
unsigned offset;
|
||||
|
||||
/**
|
||||
* Input to resource_from_handle.
|
||||
* Output from resource_get_handle.
|
||||
*/
|
||||
uint64_t format;
|
||||
|
||||
/**
|
||||
* Input to resource_from_handle.
|
||||
* Output from resource_get_handle.
|
||||
|
|
|
|||
|
|
@ -529,6 +529,7 @@ dri2_allocate_textures(struct dri_context *ctx,
|
|||
whandle.handle = buf->name;
|
||||
whandle.stride = buf->pitch;
|
||||
whandle.offset = 0;
|
||||
whandle.format = format;
|
||||
whandle.modifier = DRM_FORMAT_MOD_INVALID;
|
||||
if (screen->can_share_buffer)
|
||||
whandle.type = WINSYS_HANDLE_TYPE_SHARED;
|
||||
|
|
@ -802,6 +803,7 @@ dri2_create_image_from_name(__DRIscreen *_screen,
|
|||
memset(&whandle, 0, sizeof(whandle));
|
||||
whandle.type = WINSYS_HANDLE_TYPE_SHARED;
|
||||
whandle.handle = name;
|
||||
whandle.format = map->pipe_format;
|
||||
whandle.modifier = DRM_FORMAT_MOD_INVALID;
|
||||
|
||||
whandle.stride = pitch * util_format_get_blocksize(map->pipe_format);
|
||||
|
|
@ -903,6 +905,7 @@ dri2_create_image_from_fd(__DRIscreen *_screen,
|
|||
whandles[i].handle = (unsigned)fds[fdnum];
|
||||
whandles[i].stride = (unsigned)strides[index];
|
||||
whandles[i].offset = (unsigned)offsets[index];
|
||||
whandles[i].format = map->pipe_format;
|
||||
whandles[i].modifier = modifier;
|
||||
whandles[i].plane = index;
|
||||
}
|
||||
|
|
@ -1293,6 +1296,7 @@ dri2_from_names(__DRIscreen *screen, int width, int height, int format,
|
|||
whandle.handle = names[0];
|
||||
whandle.stride = strides[0];
|
||||
whandle.offset = offsets[0];
|
||||
whandle.format = map->pipe_format;
|
||||
whandle.modifier = DRM_FORMAT_MOD_INVALID;
|
||||
|
||||
img = dri2_create_image_from_winsys(screen, width, height, map,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue