@@ -720,6 +720,7 @@ static void ast_set_cursor_enabled(struct ast_device *ast, bool enabled)
720
720
}
721
721
722
722
static const uint32_t ast_cursor_plane_formats [] = {
723
+ DRM_FORMAT_ARGB4444 ,
723
724
DRM_FORMAT_ARGB8888 ,
724
725
};
725
726
@@ -771,17 +772,28 @@ static void ast_cursor_plane_helper_atomic_update(struct drm_plane *plane,
771
772
*/
772
773
773
774
if (drm_atomic_helper_damage_merged (old_plane_state , plane_state , & damage )) {
774
- u8 * argb4444 = ast_cursor_plane -> argb4444 ;
775
- struct iosys_map argb4444_dst [DRM_FORMAT_MAX_PLANES ] = {
776
- IOSYS_MAP_INIT_VADDR (argb4444 ),
777
- };
778
- unsigned int argb4444_dst_pitch [DRM_FORMAT_MAX_PLANES ] = {
779
- AST_HWC_PITCH ,
780
- };
781
-
782
- drm_fb_argb8888_to_argb4444 (argb4444_dst , argb4444_dst_pitch ,
783
- shadow_plane_state -> data , fb , & damage ,
784
- & shadow_plane_state -> fmtcnv_state );
775
+ u8 * argb4444 ;
776
+
777
+ switch (fb -> format -> format ) {
778
+ case DRM_FORMAT_ARGB4444 :
779
+ argb4444 = shadow_plane_state -> data [0 ].vaddr ;
780
+ break ;
781
+ default :
782
+ argb4444 = ast_cursor_plane -> argb4444 ;
783
+ {
784
+ struct iosys_map argb4444_dst [DRM_FORMAT_MAX_PLANES ] = {
785
+ IOSYS_MAP_INIT_VADDR (argb4444 ),
786
+ };
787
+ unsigned int argb4444_dst_pitch [DRM_FORMAT_MAX_PLANES ] = {
788
+ AST_HWC_PITCH ,
789
+ };
790
+
791
+ drm_fb_argb8888_to_argb4444 (argb4444_dst , argb4444_dst_pitch ,
792
+ shadow_plane_state -> data , fb , & damage ,
793
+ & shadow_plane_state -> fmtcnv_state );
794
+ }
795
+ break ;
796
+ }
785
797
ast_set_cursor_image (ast , argb4444 , fb -> width , fb -> height );
786
798
ast_set_cursor_base (ast , dst_off );
787
799
}
0 commit comments