Skip to content

Commit 3e356ec

Browse files
committed
Merge branch 'linux-6.6-trunk/at91/drm' into linux-6.6-mchp
2 parents ac9b6b8 + 4329847 commit 3e356ec

1 file changed

Lines changed: 24 additions & 3 deletions

File tree

drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -365,13 +365,34 @@ void atmel_xlcdc_plane_setup_scaler(struct atmel_hlcdc_plane *plane,
365365
xfactor);
366366

367367
/*
368-
* With YCbCr 4:2:2 and YCbYcr 4:2:0 window resampling, configuration
369-
* register LCDC_HEOCFG25.VXSCFACT and LCDC_HEOCFG27.HXSCFACT is half
368+
* With YCbCr 4:2:0 window resampling, configuration register
369+
* LCDC_HEOCFG25.VXSCFACT and LCDC_HEOCFG27.HXSCFACT values are half
370370
* the value of yfactor and xfactor.
371+
*
372+
* On the other hand, with YCbCr 4:2:2 window resampling, only the
373+
* configuration register LCDC_HEOCFG27.HXSCFACT value is half the value
374+
* of the xfactor; the value of LCDC_HEOCFG25.VXSCFACT is yfactor (no
375+
* division by 2).
371376
*/
372-
if (state->base.fb->format->format == DRM_FORMAT_YUV420) {
377+
switch (state->base.fb->format->format) {
378+
/* YCbCr 4:2:2 */
379+
case DRM_FORMAT_YUYV:
380+
case DRM_FORMAT_UYVY:
381+
case DRM_FORMAT_YVYU:
382+
case DRM_FORMAT_VYUY:
383+
case DRM_FORMAT_YUV422:
384+
case DRM_FORMAT_NV61:
385+
xfactor /= 2;
386+
break;
387+
388+
/* YCbCr 4:2:0 */
389+
case DRM_FORMAT_YUV420:
390+
case DRM_FORMAT_NV21:
373391
yfactor /= 2;
374392
xfactor /= 2;
393+
break;
394+
default:
395+
break;
375396
}
376397

377398
atmel_hlcdc_layer_write_cfg(&plane->layer, desc->layout.scaler_config + 2,

0 commit comments

Comments
 (0)