drm/v3d: Define the fourcc modifier for the Broadcom UIF format.
Subsystems (2)
PATCH 1/1 drm/v3d: Define the fourcc modifier for the Broadcom UIF format.
This will be used by Mesa, and potentially other drivers in the future, to describe tiled buffers.
--- include/uapi/drm/drm_fourcc.h | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+)
include/uapi/drm/drm_fourcc.h +21 -0
@@ -464,6 +464,27 @@ extern "C" {#define DRM_FORMAT_MOD_BROADCOM_SAND256 \ DRM_FORMAT_MOD_BROADCOM_SAND256_COL_HEIGHT(0) +/* Broadcom UIF format +* +* This is the common format for the current Broadcom multimedia +* blocks, including V3D 3.x and newer, newer video codecs, and +* displays. +* +* The image consists of utiles (64b blocks), UIF blocks (2x2 utiles), +* and macroblocks (4x4 UIF blocks). Those 4x4 UIF block groups are +* stored in columns, with padding between the columns to ensure that +* moving from one column to the next doesn't hit the same SDRAM page +* bank. +* +* To calculate the padding, it is assumed that each hardware block +* and the software driving it knows the platform's SDRAM page size, +* number of banks, and XOR address, and that it's identical between +* all blocks using the format. This tiling modifier will use XOR as +* necessary to reduce the padding. If a hardware block can't do XOR, +* the assumption is that a no-XOR tiling modifier will be created. +*/ +#define DRM_FORMAT_MOD_BROADCOM_UIF fourcc_mod_code(BROADCOM, 6) +#if defined(__cplusplus) }#endif
Signature · 6 lines
2.17.0 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Quoted 25 lines · Eric Anholt
This will be used by Mesa, and potentially other drivers in the future, to describe tiled buffers.
Signed-off-by Eric Anholt <[email protected]>--- include/uapi/drm/drm_fourcc.h | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+)include/uapi/drm/drm_fourcc.h +9
-0@@ -464,6 +464,27 @@ extern "C" {#define DRM_FORMAT_MOD_BROADCOM_SAND256 \ DRM_FORMAT_MOD_BROADCOM_SAND256_COL_HEIGHT(0) +/* Broadcom UIF format +* +* This is the common format for the current Broadcom multimedia +* blocks, including V3D 3.x and newer, newer video codecs, and +* displays. +* +* The image consists of utiles (64b blocks), UIF blocks (2x2 utiles), +* and macroblocks (4x4 UIF blocks). Those 4x4 UIF block groups are +* stored in columns, with padding between the columns to ensure that
include/uapi/drm/drm_fourcc.h extern "C" { · line 485
Quoted 10 lines
include/uapi/drm/drm_fourcc.h +10
-0+* moving from one column to the next doesn't hit the same SDRAM page +* bank. +* +* To calculate the padding, it is assumed that each hardware block +* and the software driving it knows the platform's SDRAM page size, +* number of banks, and XOR address, and that it's identical between +* all blocks using the format. This tiling modifier will use XOR as +* necessary to reduce the padding. If a hardware block can't do XOR, +* the assumption is that a no-XOR tiling modifier will be created. +*/
I think for as long as a modifier is only for a specific SoC, and not e.g. also meant for pci devices, it's perfectly fine to heavily rely on platform specific "every block agrees" language like here. We do the same for intel's X/Y tiling on older chips (latest gens stopped doing funky swizzling because the memory controllers seem to be better).
Quoted 12 lines
include/uapi/drm/drm_fourcc.h +2
-0+#define DRM_FORMAT_MOD_BROADCOM_UIF fourcc_mod_code(BROADCOM, 6) +#if defined(__cplusplus) }#endif Signature · 6 lines
2.17.0 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Signature · 7 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Quoted 43 lines · Daniel Vetter
Quoted 25 lines · Eric Anholt
This will be used by Mesa, and potentially other drivers in the future, to describe tiled buffers.
Signed-off-by Eric Anholt <[email protected]>--- include/uapi/drm/drm_fourcc.h | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+)include/uapi/drm/drm_fourcc.h +9
-0@@ -464,6 +464,27 @@ extern "C" {#define DRM_FORMAT_MOD_BROADCOM_SAND256 \ DRM_FORMAT_MOD_BROADCOM_SAND256_COL_HEIGHT(0) +/* Broadcom UIF format +* +* This is the common format for the current Broadcom multimedia +* blocks, including V3D 3.x and newer, newer video codecs, and +* displays. +* +* The image consists of utiles (64b blocks), UIF blocks (2x2 utiles), +* and macroblocks (4x4 UIF blocks). Those 4x4 UIF block groups are +* stored in columns, with padding between the columns to ensure that include/uapi/drm/drm_fourcc.h extern "C" { · line 485
Quoted 10 lines
include/uapi/drm/drm_fourcc.h +10
-0+* moving from one column to the next doesn't hit the same SDRAM page +* bank. +* +* To calculate the padding, it is assumed that each hardware block +* and the software driving it knows the platform's SDRAM page size, +* number of banks, and XOR address, and that it's identical between +* all blocks using the format. This tiling modifier will use XOR as +* necessary to reduce the padding. If a hardware block can't do XOR, +* the assumption is that a no-XOR tiling modifier will be created. +*/ I think for as long as a modifier is only for a specific SoC, and not e.g. also meant for pci devices, it's perfectly fine to heavily rely on platform specific "every block agrees" language like here. We do the same for intel's X/Y tiling on older chips (latest gens stopped doing funky swizzling because the memory controllers seem to be better).
Quoted 1 line
Acked-by Daniel Vetter <[email protected]>
Yeah, this is very similar to the Intel swizzling.
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel