Skip to contentSkip to conversation

drm/tegra: Correct DRM_FORMAT_MOD_NVIDIA_SECTOR_LAYOUT

PATCH Applied Dmitry Osipenko 2 participants 2 messages May 30, 2021 – May 31, 2021

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/tegra: Correct DRM_FORMAT_MOD_NVIDIA_SECTOR_LAYOUT

The format modifier is 64bit, while DRM_FORMAT_MOD_NVIDIA_SECTOR_LAYOUT uses BIT() macro that is 32bit on ARM32.

The (modifier &= ~DRM_FORMAT_MOD_NVIDIA_SECTOR_LAYOUT) doesn't work as expected on ARM32 and tegra_fb_get_tiling() fails for the tiled formats on 32bit Tegra because modifier mask isn't applied properly. Use the BIT_ULL() macro to fix this trouble.

Fixes 7b6f846785f4 ("drm/tegra: Support sector layout on Tegra194")
---
 drivers/gpu/drm/tegra/drm.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/tegra/drm.h +1 -1
index 87df251c1fcf..0cb868065348 100644
@@ -25,7 +25,7 @@
 #include "trace.h"
 
 /* XXX move to include/uapi/drm/drm_fourcc.h? */
-#define DRM_FORMAT_MOD_NVIDIA_SECTOR_LAYOUT BIT(22)
+#define DRM_FORMAT_MOD_NVIDIA_SECTOR_LAYOUT BIT_ULL(22)
 
 struct reset_control;
 
Signature · 1 line
2.30.2
#1 lore raw

From: Thierry Reding <[email protected]>

Quoted 7 lines · Dmitry Osipenko

The format modifier is 64bit, while DRM_FORMAT_MOD_NVIDIA_SECTOR_LAYOUT uses BIT() macro that is 32bit on ARM32.

The (modifier &= ~DRM_FORMAT_MOD_NVIDIA_SECTOR_LAYOUT) doesn't work as expected on ARM32 and tegra_fb_get_tiling() fails for the tiled formats on 32bit Tegra because modifier mask isn't applied properly. Use the BIT_ULL() macro to fix this trouble.

Applied, thanks!

[1/1] drm/tegra: Correct DRM_FORMAT_MOD_NVIDIA_SECTOR_LAYOUT

      commit: cdbbb5978467469a2ee2311ef0efc407f8c0bfea

Best regards,

Signature · 1 line
Thierry Reding <[email protected]>