@@ -302,6 +302,7 @@ struct drm_plane_state *vc4_plane_duplicate_state(struct drm_plane *plane)
302
302
refcount_inc (& hvs -> lbm_refcounts [vc4_state -> lbm_handle ].refcount );
303
303
304
304
vc4_state -> dlist_initialized = 0 ;
305
+ vc4_state -> is_yuv444_unity = false;
305
306
306
307
__drm_atomic_helper_plane_duplicate_state (plane , & vc4_state -> base );
307
308
@@ -871,6 +872,10 @@ static void vc4_write_scaling_parameters(struct drm_plane_state *state,
871
872
{
872
873
struct vc4_dev * vc4 = to_vc4_dev (state -> plane -> dev );
873
874
struct vc4_plane_state * vc4_state = to_vc4_plane_state (state );
875
+ bool no_interpolate = state -> scaling_filter == DRM_SCALING_FILTER_NEAREST_NEIGHBOR ;
876
+
877
+ if (vc4_state -> is_yuv444_unity )
878
+ no_interpolate = 1 ;
874
879
875
880
WARN_ON_ONCE (vc4 -> gen > VC4_GEN_6_D );
876
881
@@ -879,15 +884,15 @@ static void vc4_write_scaling_parameters(struct drm_plane_state *state,
879
884
vc4_write_ppf (vc4_state , vc4_state -> src_w [channel ],
880
885
vc4_state -> crtc_w , vc4_state -> src_x , channel ,
881
886
state -> chroma_siting_h ,
882
- state -> scaling_filter == DRM_SCALING_FILTER_NEAREST_NEIGHBOR );
887
+ no_interpolate );
883
888
}
884
889
885
890
/* Ch0 V-PPF Words 0-1: Scaling Parameters, Context */
886
891
if (vc4_state -> y_scaling [channel ] == VC4_SCALING_PPF ) {
887
892
vc4_write_ppf (vc4_state , vc4_state -> src_h [channel ],
888
893
vc4_state -> crtc_h , vc4_state -> src_y , channel ,
889
894
state -> chroma_siting_v ,
890
- state -> scaling_filter == DRM_SCALING_FILTER_NEAREST_NEIGHBOR );
895
+ no_interpolate );
891
896
vc4_dlist_write (vc4_state , 0xc0c0c0c0 );
892
897
}
893
898
@@ -1867,12 +1872,19 @@ static int vc6_plane_mode_set(struct drm_plane *plane,
1867
1872
if (vc4_state -> x_scaling [0 ] == VC4_SCALING_NONE ) {
1868
1873
vc4_state -> x_scaling [0 ] = VC4_SCALING_PPF ;
1869
1874
vc4_state -> is_unity = false;
1875
+ vc4_state -> is_yuv444_unity = true;
1870
1876
}
1871
1877
1872
1878
if (vc4_state -> y_scaling [0 ] == VC4_SCALING_NONE ) {
1873
1879
vc4_state -> y_scaling [0 ] = VC4_SCALING_PPF ;
1874
1880
vc4_state -> is_unity = false;
1881
+ } else {
1882
+ /* Ensure that resizing vertically but not horizontally
1883
+ * doesn't switch the scaling filter.
1884
+ */
1885
+ vc4_state -> is_yuv444_unity = false;
1875
1886
}
1887
+
1876
1888
}
1877
1889
1878
1890
if (!vc4_state -> src_w [0 ] || !vc4_state -> src_h [0 ] ||
@@ -2199,6 +2211,9 @@ static int vc6_plane_mode_set(struct drm_plane *plane,
2199
2211
filter = & vc4 -> hvs -> nearest_neighbour_filter ;
2200
2212
break ;
2201
2213
}
2214
+ if (vc4_state -> is_yuv444_unity )
2215
+ filter = & vc4 -> hvs -> nearest_neighbour_filter ;
2216
+
2202
2217
u32 kernel = VC4_SET_FIELD (filter -> start ,
2203
2218
SCALER_PPF_KERNEL_OFFSET );
2204
2219
0 commit comments