v3d: Fix tiling modifier support to use the new UIF define.
You can't use T tiled buffers on V3D 3.x and newer, it's been replaced with a newer layout shared with other hardware blocks.
This commit is contained in:
parent
6c0482e176
commit
2c6279d58b
|
@ -324,6 +324,17 @@ v3d_resource_get_handle(struct pipe_screen *pscreen,
|
||||||
*/
|
*/
|
||||||
bo->private = false;
|
bo->private = false;
|
||||||
|
|
||||||
|
if (rsc->tiled) {
|
||||||
|
/* A shared tiled buffer should always be allocated as UIF,
|
||||||
|
* not UBLINEAR or LT.
|
||||||
|
*/
|
||||||
|
assert(rsc->slices[0].tiling == VC5_TILING_UIF_XOR ||
|
||||||
|
rsc->slices[0].tiling == VC5_TILING_UIF_NO_XOR);
|
||||||
|
whandle->modifier = DRM_FORMAT_MOD_BROADCOM_UIF;
|
||||||
|
} else {
|
||||||
|
whandle->modifier = DRM_FORMAT_MOD_LINEAR;
|
||||||
|
}
|
||||||
|
|
||||||
switch (whandle->type) {
|
switch (whandle->type) {
|
||||||
case WINSYS_HANDLE_TYPE_SHARED:
|
case WINSYS_HANDLE_TYPE_SHARED:
|
||||||
return v3d_bo_flink(bo, &whandle->handle);
|
return v3d_bo_flink(bo, &whandle->handle);
|
||||||
|
@ -651,7 +662,7 @@ v3d_resource_create_with_modifiers(struct pipe_screen *pscreen,
|
||||||
linear_ok = true;
|
linear_ok = true;
|
||||||
rsc->tiled = should_tile;
|
rsc->tiled = should_tile;
|
||||||
} else if (should_tile &&
|
} else if (should_tile &&
|
||||||
find_modifier(DRM_FORMAT_MOD_BROADCOM_VC4_T_TILED,
|
find_modifier(DRM_FORMAT_MOD_BROADCOM_UIF,
|
||||||
modifiers, count)) {
|
modifiers, count)) {
|
||||||
rsc->tiled = true;
|
rsc->tiled = true;
|
||||||
} else if (linear_ok) {
|
} else if (linear_ok) {
|
||||||
|
@ -697,10 +708,12 @@ v3d_resource_from_handle(struct pipe_screen *pscreen,
|
||||||
|
|
||||||
switch (whandle->modifier) {
|
switch (whandle->modifier) {
|
||||||
case DRM_FORMAT_MOD_LINEAR:
|
case DRM_FORMAT_MOD_LINEAR:
|
||||||
case DRM_FORMAT_MOD_INVALID:
|
|
||||||
rsc->tiled = false;
|
rsc->tiled = false;
|
||||||
break;
|
break;
|
||||||
/* XXX: UIF */
|
case DRM_FORMAT_MOD_BROADCOM_UIF:
|
||||||
|
case DRM_FORMAT_MOD_INVALID:
|
||||||
|
rsc->tiled = true;
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
fprintf(stderr,
|
fprintf(stderr,
|
||||||
"Attempt to import unsupported modifier 0x%llx\n",
|
"Attempt to import unsupported modifier 0x%llx\n",
|
||||||
|
|
Loading…
Reference in New Issue