Skip to contentSkip to conversation

drm/fourcc: fix Amlogic Video Framebuffer Compression macro

PATCH In review Neil Armstrong 2 participants 4 messages Jul 23, 2020 – Jul 27, 2020

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

PATCH 1/2 drm/fourcc: fix Amlogic Video Framebuffer Compression macro

Fix the Amlogic Video Framebuffer Compression modifier macro to correctly add the layout options, a pair of parenthesis was missing.

Fixes d6528ec88309 ("drm/fourcc: Add modifier definitions for describing Amlogic Video Framebuffer Compression")
---
 include/uapi/drm/drm_fourcc.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/uapi/drm/drm_fourcc.h +1 -1
index 4bee7de5f306..82f327801267 100644
@@ -1004,7 +1004,7 @@ drm_fourcc_canonicalize_nvidia_format_mod(__u64 modifier)
 #define DRM_FORMAT_MOD_AMLOGIC_FBC(__layout, __options) \
 	fourcc_mod_code(AMLOGIC, \
 			((__layout) & __fourcc_mod_amlogic_layout_mask) | \
-			((__options) & __fourcc_mod_amlogic_options_mask \
+			(((__options) & __fourcc_mod_amlogic_options_mask) \
 			 << __fourcc_mod_amlogic_options_shift))
 
 /* Amlogic FBC Layouts */
Signature · 6 lines
2.22.0

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#1 lore raw

PATCH 2/2 drm/meson: overlay: fix Amlogic Compressed Framebuffer modifier layout extract

The bitwise operation worked because the result is casted in a lower bits integer, and was not changed after the modifier defines rework.

Use the correct operation as already used in meson_overlay_atomic_update().

Fixes e860785d5730 ("drm/meson: overlay: setup overlay for Amlogic FBC")
---
 drivers/gpu/drm/meson/meson_overlay.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/gpu/drm/meson/meson_overlay.c +1 -2
index a8bcc70644df..83ec613bbfb6 100644
@@ -756,8 +756,7 @@ static bool meson_overlay_format_mod_supported(struct drm_plane *plane,
 	if ((modifier & DRM_FORMAT_MOD_AMLOGIC_FBC(0, 0)) ==
 			DRM_FORMAT_MOD_AMLOGIC_FBC(0, 0)) {
 		unsigned int layout = modifier &
-			DRM_FORMAT_MOD_AMLOGIC_FBC(
-				__fourcc_mod_amlogic_layout_mask, 0);
+			__fourcc_mod_amlogic_layout_mask;
 		unsigned int options =
 			(modifier >> __fourcc_mod_amlogic_options_shift) &
 			__fourcc_mod_amlogic_options_mask;
Signature · 6 lines
2.22.0

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Acked-by on v1 1/2
#2 lore raw
In reply to Neil Armstrong

Hi Neil.

Quoted 5 lines · Neil Armstrong

Fix the Amlogic Video Framebuffer Compression modifier macro to correctly add the layout options, a pair of parenthesis was missing.

Fixes d6528ec88309 ("drm/fourcc: Add modifier definitions for describing Amlogic Video Framebuffer Compression")

Looks correct just looking at the patch below.

I assume you will apply the patch.

Sam

Quoted 24 lines
---
 include/uapi/drm/drm_fourcc.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/uapi/drm/drm_fourcc.h +1 -1
index 4bee7de5f306..82f327801267 100644
@@ -1004,7 +1004,7 @@ drm_fourcc_canonicalize_nvidia_format_mod(__u64 modifier)
 #define DRM_FORMAT_MOD_AMLOGIC_FBC(__layout, __options) \
 	fourcc_mod_code(AMLOGIC, \
 			((__layout) & __fourcc_mod_amlogic_layout_mask) | \
-			((__options) & __fourcc_mod_amlogic_options_mask \
+			(((__options) & __fourcc_mod_amlogic_options_mask) \
 			 << __fourcc_mod_amlogic_options_shift))
 
 /* Amlogic FBC Layouts */
Signature · 6 lines
2.22.0

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#3 lore raw
Quoted 6 lines · Sam Ravnborg

Hi Neil.

Quoted 3 lines · Neil Armstrong

Fix the Amlogic Video Framebuffer Compression modifier macro to correctly add the layout options, a pair of parenthesis was missing.

Quoted 6 lines
Quoted 2 lines
Fixes d6528ec88309 ("drm/fourcc: Add modifier definitions for describing Amlogic Video Framebuffer Compression")

Looks correct just looking at the patch below.

I assume you will apply the patch.

Yes, indeed

Thanks !
Neil

Quoted 19 lines

Sam

Quoted 16 lines
---
 include/uapi/drm/drm_fourcc.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/uapi/drm/drm_fourcc.h +1 -1
index 4bee7de5f306..82f327801267 100644
@@ -1004,7 +1004,7 @@ drm_fourcc_canonicalize_nvidia_format_mod(__u64 modifier)
 #define DRM_FORMAT_MOD_AMLOGIC_FBC(__layout, __options) \
 	fourcc_mod_code(AMLOGIC, \
 			((__layout) & __fourcc_mod_amlogic_layout_mask) | \
-			((__options) & __fourcc_mod_amlogic_options_mask \
+			(((__options) & __fourcc_mod_amlogic_options_mask) \
 			 << __fourcc_mod_amlogic_options_shift))
 
Quoted 8 lines
Quoted 8 lines
include/uapi/drm/drm_fourcc.h +0 -0
 /* Amlogic FBC Layouts */
Signature · 6 lines
2.22.0

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel