mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-22 20:00:10 +01:00
gallium: add PIPE_RESOURCE_PARAM_DISJOINT_PLANES
To query if a DRI_IMAGE has separate plane buffer handle. radeonsi's DCC compressed dri image has multiple planes (compressed data and metadata). But they share the same buffer with different offsets, so we only need one buffer handle for them. This attribute is used to distinguish single buffer multi plane image from multi buffer multi plane image. Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com> Reviewed-by: Marek Olšák <marek.olsak@amd.com> Acked-by: Daniel Stone <daniels@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31658>
This commit is contained in:
parent
310cfda034
commit
41cde01b0b
5 changed files with 20 additions and 0 deletions
|
|
@ -722,6 +722,12 @@ static bool si_resource_get_param(struct pipe_screen *screen, struct pipe_contex
|
|||
return true;
|
||||
case PIPE_RESOURCE_PARAM_LAYER_STRIDE:
|
||||
break;
|
||||
case PIPE_RESOURCE_PARAM_DISJOINT_PLANES:
|
||||
if (resource->target == PIPE_BUFFER)
|
||||
*value = false;
|
||||
else
|
||||
*value = tex->num_planes > 1;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1927,6 +1927,12 @@ zink_resource_get_param(struct pipe_screen *pscreen, struct pipe_context *pctx,
|
|||
return false;
|
||||
#endif
|
||||
}
|
||||
case PIPE_RESOURCE_PARAM_DISJOINT_PLANES:
|
||||
if (pres->target == PIPE_BUFFER)
|
||||
*value = false;
|
||||
else
|
||||
*value = util_format_get_num_planes(pres->format) > 1;
|
||||
break;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1148,6 +1148,9 @@ dri2_query_image_by_resource_param(struct dri_image *image, int attrib, int *val
|
|||
case __DRI_IMAGE_ATTRIB_FD:
|
||||
param = PIPE_RESOURCE_PARAM_HANDLE_TYPE_FD;
|
||||
break;
|
||||
case __DRI_IMAGE_ATTRIB_DISJOINT_PLANES:
|
||||
param = PIPE_RESOURCE_PARAM_DISJOINT_PLANES;
|
||||
break;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
|
|
@ -1161,6 +1164,7 @@ dri2_query_image_by_resource_param(struct dri_image *image, int attrib, int *val
|
|||
case __DRI_IMAGE_ATTRIB_STRIDE:
|
||||
case __DRI_IMAGE_ATTRIB_OFFSET:
|
||||
case __DRI_IMAGE_ATTRIB_NUM_PLANES:
|
||||
case __DRI_IMAGE_ATTRIB_DISJOINT_PLANES:
|
||||
if (res_param > INT_MAX)
|
||||
return false;
|
||||
*value = (int)res_param;
|
||||
|
|
|
|||
|
|
@ -588,6 +588,8 @@ enum dri_loader_cap {
|
|||
#define __DRI_IMAGE_ATTRIB_MODIFIER_LOWER 0x200B /* available in versions 14 */
|
||||
#define __DRI_IMAGE_ATTRIB_MODIFIER_UPPER 0x200C /* available in versions 14 */
|
||||
#define __DRI_IMAGE_ATTRIB_COMPRESSION_RATE 0x200D /* available in versions 22 */
|
||||
/* If DRI IMAGE has separate plane buffers. */
|
||||
#define __DRI_IMAGE_ATTRIB_DISJOINT_PLANES 0x200E
|
||||
|
||||
enum __DRIYUVColorSpace {
|
||||
__DRI_YUV_COLOR_SPACE_UNDEFINED = 0,
|
||||
|
|
|
|||
|
|
@ -1168,6 +1168,8 @@ enum pipe_resource_param
|
|||
PIPE_RESOURCE_PARAM_HANDLE_TYPE_KMS,
|
||||
PIPE_RESOURCE_PARAM_HANDLE_TYPE_FD,
|
||||
PIPE_RESOURCE_PARAM_LAYER_STRIDE,
|
||||
/* If texture/image has separate plane buffers. */
|
||||
PIPE_RESOURCE_PARAM_DISJOINT_PLANES,
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue