@@ -1878,28 +1878,6 @@ static bool vop2_output_yc_swap(uint32_t bus_format)
1878
1878
}
1879
1879
}
1880
1880
1881
- static bool is_yuv_support (uint32_t format )
1882
- {
1883
- switch (format ) {
1884
- case DRM_FORMAT_NV12 :
1885
- case DRM_FORMAT_NV15 :
1886
- case DRM_FORMAT_NV16 :
1887
- case DRM_FORMAT_NV20 :
1888
- case DRM_FORMAT_NV24 :
1889
- case DRM_FORMAT_NV30 :
1890
- case DRM_FORMAT_YUYV :
1891
- case DRM_FORMAT_YVYU :
1892
- case DRM_FORMAT_UYVY :
1893
- case DRM_FORMAT_VYUY :
1894
- case DRM_FORMAT_YUV420_8BIT :
1895
- case DRM_FORMAT_YUV420_10BIT :
1896
- case DRM_FORMAT_Y210 :
1897
- return true;
1898
- default :
1899
- return false;
1900
- }
1901
- }
1902
-
1903
1881
static bool is_yuv_output (uint32_t bus_format )
1904
1882
{
1905
1883
switch (bus_format ) {
@@ -2392,7 +2370,7 @@ static void vop2_setup_csc_mode(struct vop2_video_port *vp,
2392
2370
{
2393
2371
struct drm_plane_state * pstate = & vpstate -> base ;
2394
2372
struct rockchip_crtc_state * vcstate = to_rockchip_crtc_state (vp -> rockchip_crtc .crtc .state );
2395
- int is_input_yuv = is_yuv_support ( pstate -> fb -> format -> format ) ;
2373
+ int is_input_yuv = pstate -> fb -> format -> is_yuv ;
2396
2374
int is_output_yuv = vcstate -> yuv_overlay ;
2397
2375
int input_csc = vpstate -> color_space ;
2398
2376
int output_csc = vcstate -> color_space ;
@@ -2696,7 +2674,7 @@ static int vop2_wb_encoder_atomic_check(struct drm_encoder *encoder,
2696
2674
fb = conn_state -> writeback_job -> fb ;
2697
2675
DRM_DEV_DEBUG (vp -> vop2 -> dev , "%d x % d\n" , fb -> width , fb -> height );
2698
2676
2699
- if (!is_yuv_support ( fb -> format -> format ) && is_yuv_output (vcstate -> bus_format )) {
2677
+ if (!fb -> format -> is_yuv && is_yuv_output (vcstate -> bus_format )) {
2700
2678
DRM_ERROR ("YUV2RGB is not supported by writeback\n" );
2701
2679
return - EINVAL ;
2702
2680
}
@@ -2839,7 +2817,7 @@ static void vop2_wb_commit(struct drm_crtc *crtc)
2839
2817
fifo_throd = fb -> pitches [0 ] >> 4 ;
2840
2818
if (fifo_throd >= vop2 -> data -> wb -> fifo_depth )
2841
2819
fifo_throd = vop2 -> data -> wb -> fifo_depth ;
2842
- r2y = is_yuv_support ( fb -> format -> format ) && (!is_yuv_output (vcstate -> bus_format ));
2820
+ r2y = fb -> format -> is_yuv && (!is_yuv_output (vcstate -> bus_format ));
2843
2821
2844
2822
/*
2845
2823
* the vp_id register config done immediately
@@ -4618,7 +4596,7 @@ static void vop2_plane_atomic_update(struct drm_plane *plane, struct drm_plane_s
4618
4596
planlist -> dump_info .AFBC_flag = AFBC_flag ;
4619
4597
planlist -> dump_info .area_id = win -> area_id ;
4620
4598
planlist -> dump_info .win_id = win -> win_id ;
4621
- planlist -> dump_info .yuv_format = is_yuv_support ( fb -> format -> format ) ;
4599
+ planlist -> dump_info .yuv_format = fb -> format -> is_yuv ;
4622
4600
planlist -> dump_info .num_pages = num_pages ;
4623
4601
planlist -> dump_info .pages = pages ;
4624
4602
planlist -> dump_info .offset = vpstate -> offset ;
0 commit comments