@@ -729,12 +729,40 @@ static int dpu_plane_check_inline_rotation(struct dpu_plane *pdpu,
729
729
static int dpu_plane_atomic_check_pipe (struct dpu_plane * pdpu ,
730
730
struct dpu_sw_pipe * pipe ,
731
731
struct dpu_sw_pipe_cfg * pipe_cfg ,
732
- const struct msm_format * fmt ,
733
- const struct drm_display_mode * mode )
732
+ const struct drm_display_mode * mode ,
733
+ struct drm_plane_state * new_plane_state )
734
734
{
735
735
uint32_t min_src_size ;
736
736
struct dpu_kms * kms = _dpu_plane_get_kms (& pdpu -> base );
737
737
int ret ;
738
+ const struct msm_format * fmt ;
739
+ uint32_t supported_rotations ;
740
+ const struct dpu_sspp_cfg * pipe_hw_caps ;
741
+ const struct dpu_sspp_sub_blks * sblk ;
742
+
743
+ pipe_hw_caps = pipe -> sspp -> cap ;
744
+ sblk = pipe -> sspp -> cap -> sblk ;
745
+
746
+ /*
747
+ * We already have verified scaling against platform limitations.
748
+ * Now check if the SSPP supports scaling at all.
749
+ */
750
+ if (!sblk -> scaler_blk .len &&
751
+ ((drm_rect_width (& new_plane_state -> src ) >> 16 !=
752
+ drm_rect_width (& new_plane_state -> dst )) ||
753
+ (drm_rect_height (& new_plane_state -> src ) >> 16 !=
754
+ drm_rect_height (& new_plane_state -> dst ))))
755
+ return - ERANGE ;
756
+
757
+ fmt = msm_framebuffer_format (new_plane_state -> fb );
758
+
759
+ supported_rotations = DRM_MODE_REFLECT_MASK | DRM_MODE_ROTATE_0 ;
760
+
761
+ if (pipe_hw_caps -> features & BIT (DPU_SSPP_INLINE_ROTATION ))
762
+ supported_rotations |= DRM_MODE_ROTATE_90 ;
763
+
764
+ pipe_cfg -> rotation = drm_rotation_simplify (new_plane_state -> rotation ,
765
+ supported_rotations );
738
766
739
767
min_src_size = MSM_FORMAT_IS_YUV (fmt ) ? 2 : 1 ;
740
768
@@ -923,47 +951,20 @@ static int dpu_plane_atomic_check_sspp(struct drm_plane *plane,
923
951
struct dpu_plane_state * pstate = to_dpu_plane_state (new_plane_state );
924
952
struct dpu_sw_pipe * pipe = & pstate -> pipe ;
925
953
struct dpu_sw_pipe * r_pipe = & pstate -> r_pipe ;
926
- const struct msm_format * fmt ;
927
954
struct dpu_sw_pipe_cfg * pipe_cfg = & pstate -> pipe_cfg ;
928
955
struct dpu_sw_pipe_cfg * r_pipe_cfg = & pstate -> r_pipe_cfg ;
929
- uint32_t supported_rotations ;
930
- const struct dpu_sspp_cfg * pipe_hw_caps ;
931
- const struct dpu_sspp_sub_blks * sblk ;
932
956
int ret = 0 ;
933
957
934
- pipe_hw_caps = pipe -> sspp -> cap ;
935
- sblk = pipe -> sspp -> cap -> sblk ;
936
-
937
- /*
938
- * We already have verified scaling against platform limitations.
939
- * Now check if the SSPP supports scaling at all.
940
- */
941
- if (!sblk -> scaler_blk .len &&
942
- ((drm_rect_width (& new_plane_state -> src ) >> 16 !=
943
- drm_rect_width (& new_plane_state -> dst )) ||
944
- (drm_rect_height (& new_plane_state -> src ) >> 16 !=
945
- drm_rect_height (& new_plane_state -> dst ))))
946
- return - ERANGE ;
947
-
948
- fmt = msm_framebuffer_format (new_plane_state -> fb );
949
-
950
- supported_rotations = DRM_MODE_REFLECT_MASK | DRM_MODE_ROTATE_0 ;
951
-
952
- if (pipe_hw_caps -> features & BIT (DPU_SSPP_INLINE_ROTATION ))
953
- supported_rotations |= DRM_MODE_ROTATE_90 ;
954
-
955
- pipe_cfg -> rotation = drm_rotation_simplify (new_plane_state -> rotation ,
956
- supported_rotations );
957
- r_pipe_cfg -> rotation = pipe_cfg -> rotation ;
958
-
959
- ret = dpu_plane_atomic_check_pipe (pdpu , pipe , pipe_cfg , fmt ,
960
- & crtc_state -> adjusted_mode );
958
+ ret = dpu_plane_atomic_check_pipe (pdpu , pipe , pipe_cfg ,
959
+ & crtc_state -> adjusted_mode ,
960
+ new_plane_state );
961
961
if (ret )
962
962
return ret ;
963
963
964
964
if (drm_rect_width (& r_pipe_cfg -> src_rect ) != 0 ) {
965
- ret = dpu_plane_atomic_check_pipe (pdpu , r_pipe , r_pipe_cfg , fmt ,
966
- & crtc_state -> adjusted_mode );
965
+ ret = dpu_plane_atomic_check_pipe (pdpu , r_pipe , r_pipe_cfg ,
966
+ & crtc_state -> adjusted_mode ,
967
+ new_plane_state );
967
968
if (ret )
968
969
return ret ;
969
970
}
0 commit comments