@@ -2677,6 +2677,12 @@ int skl_format_to_fourcc(int format, bool rgb_order, bool alpha)
26772677 return DRM_FORMAT_RGB565 ;
26782678 case PLANE_CTL_FORMAT_NV12 :
26792679 return DRM_FORMAT_NV12 ;
2680+ case PLANE_CTL_FORMAT_P010 :
2681+ return DRM_FORMAT_P010 ;
2682+ case PLANE_CTL_FORMAT_P012 :
2683+ return DRM_FORMAT_P012 ;
2684+ case PLANE_CTL_FORMAT_P016 :
2685+ return DRM_FORMAT_P016 ;
26802686 default :
26812687 case PLANE_CTL_FORMAT_XRGB_8888 :
26822688 if (rgb_order ) {
@@ -3176,7 +3182,7 @@ int skl_check_plane_surface(struct intel_plane_state *plane_state)
31763182 * Handle the AUX surface first since
31773183 * the main surface setup depends on it.
31783184 */
3179- if (fb -> format -> format == DRM_FORMAT_NV12 ) {
3185+ if (is_planar_yuv_format ( fb -> format -> format ) ) {
31803186 ret = skl_check_nv12_aux_surface (plane_state );
31813187 if (ret )
31823188 return ret ;
@@ -3600,6 +3606,12 @@ static u32 skl_plane_ctl_format(u32 pixel_format)
36003606 return PLANE_CTL_FORMAT_YUV422 | PLANE_CTL_YUV422_VYUY ;
36013607 case DRM_FORMAT_NV12 :
36023608 return PLANE_CTL_FORMAT_NV12 ;
3609+ case DRM_FORMAT_P010 :
3610+ return PLANE_CTL_FORMAT_P010 ;
3611+ case DRM_FORMAT_P012 :
3612+ return PLANE_CTL_FORMAT_P012 ;
3613+ case DRM_FORMAT_P016 :
3614+ return PLANE_CTL_FORMAT_P016 ;
36033615 default :
36043616 MISSING_CASE (pixel_format );
36053617 }
@@ -5036,9 +5048,9 @@ skl_update_scaler(struct intel_crtc_state *crtc_state, bool force_detach,
50365048 return 0 ;
50375049 }
50385050
5039- if (format && format -> format == DRM_FORMAT_NV12 &&
5051+ if (format && is_planar_yuv_format ( format -> format ) &&
50405052 (src_h < SKL_MIN_YUV_420_SRC_H || src_w < SKL_MIN_YUV_420_SRC_W )) {
5041- DRM_DEBUG_KMS ("NV12 : src dimensions not met\n" );
5053+ DRM_DEBUG_KMS ("Planar YUV : src dimensions not met\n" );
50425054 return - EINVAL ;
50435055 }
50445056
@@ -5112,7 +5124,7 @@ static int skl_update_scaler_plane(struct intel_crtc_state *crtc_state,
51125124
51135125 /* Pre-gen11 and SDR planes always need a scaler for planar formats. */
51145126 if (!icl_is_hdr_plane (intel_plane ) &&
5115- fb && fb -> format -> format == DRM_FORMAT_NV12 )
5127+ fb && is_planar_yuv_format ( fb -> format -> format ) )
51165128 need_scaler = true;
51175129
51185130 ret = skl_update_scaler (crtc_state , force_detach ,
@@ -5149,6 +5161,9 @@ static int skl_update_scaler_plane(struct intel_crtc_state *crtc_state,
51495161 case DRM_FORMAT_UYVY :
51505162 case DRM_FORMAT_VYUY :
51515163 case DRM_FORMAT_NV12 :
5164+ case DRM_FORMAT_P010 :
5165+ case DRM_FORMAT_P012 :
5166+ case DRM_FORMAT_P016 :
51525167 break ;
51535168 default :
51545169 DRM_DEBUG_KMS ("[PLANE:%d:%s] FB:%d unsupported scaling format 0x%x\n" ,
@@ -11134,7 +11149,7 @@ static int icl_check_nv12_planes(struct intel_crtc_state *crtc_state)
1113411149 }
1113511150
1113611151 if (!linked_state ) {
11137- DRM_DEBUG_KMS ("Need %d free Y planes for NV12 \n" ,
11152+ DRM_DEBUG_KMS ("Need %d free Y planes for planar YUV \n" ,
1113811153 hweight8 (crtc_state -> nv12_planes ));
1113911154
1114011155 return - EINVAL ;
@@ -13767,7 +13782,7 @@ skl_max_scale(const struct intel_crtc_state *crtc_state,
1376713782 * or
1376813783 * cdclk/crtc_clock
1376913784 */
13770- mult = pixel_format == DRM_FORMAT_NV12 ? 2 : 3 ;
13785+ mult = is_planar_yuv_format ( pixel_format ) ? 2 : 3 ;
1377113786 tmpclk1 = (1 << 16 ) * mult - 1 ;
1377213787 tmpclk2 = (1 << 8 ) * ((max_dotclk << 8 ) / crtc_clock );
1377313788 max_scale = min (tmpclk1 , tmpclk2 );
0 commit comments