]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
drm: atmel-hlcdc: add vertical and horizontal scaling support for XLCDC
authorManikandan Muralidharan <manikandan.m@microchip.com>
Wed, 24 Apr 2024 05:33:49 +0000 (11:03 +0530)
committerSam Ravnborg <sam@ravnborg.org>
Thu, 30 May 2024 13:47:02 +0000 (15:47 +0200)
Update the vertical and horizontal scaler registers of XLCDC IP
with Bilinear and Bicubic co-efficients taps for Chroma and
Luma componenets of the Pixel.

Signed-off-by: Manikandan Muralidharan <manikandan.m@microchip.com>
Acked-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20240424053351.589830-7-manikandan.m@microchip.com
drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.h
drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c

index 1153d402f81009ace0fd0862798c3efa3c5246b2..e1a0bb24b5111038c56b3a0dbbe8447f86e7205f 100644 (file)
  * @disc_pos: discard area position register
  * @disc_size: discard area size register
  * @csc: color space conversion register
+ * @vxs_config: vertical scalar filter taps control register
+ * @hxs_config: horizontal scalar filter taps control register
  */
 struct atmel_hlcdc_layer_cfg_layout {
        int xstride[ATMEL_HLCDC_LAYER_MAX_PLANES];
@@ -217,6 +219,8 @@ struct atmel_hlcdc_layer_cfg_layout {
        int disc_pos;
        int disc_size;
        int csc;
+       int vxs_config;
+       int hxs_config;
 };
 
 /**
index f60367dc6d9df7cc33ea0e8306482061e9e7f359..4a7ba0918eca19eca3fd8febd1db1b2d3a8a6e14 100644 (file)
@@ -966,6 +966,26 @@ static void atmel_xlcdc_csc_init(struct atmel_hlcdc_plane *plane,
                                            desc->layout.csc + i,
                                            xlcdc_csc_coeffs[i]);
        }
+
+       if (desc->layout.vxs_config && desc->layout.hxs_config) {
+               /*
+                * Updating vxs.config and hxs.config fixes the
+                * Green Color Issue in SAM9X7 EGT Video Player App
+                */
+               atmel_hlcdc_layer_write_cfg(&plane->layer,
+                                           desc->layout.vxs_config,
+                                           ATMEL_XLCDC_LAYER_VXSYCFG_ONE |
+                                           ATMEL_XLCDC_LAYER_VXSYTAP2_ENABLE |
+                                           ATMEL_XLCDC_LAYER_VXSCCFG_ONE |
+                                           ATMEL_XLCDC_LAYER_VXSCTAP2_ENABLE);
+
+               atmel_hlcdc_layer_write_cfg(&plane->layer,
+                                           desc->layout.hxs_config,
+                                           ATMEL_XLCDC_LAYER_HXSYCFG_ONE |
+                                           ATMEL_XLCDC_LAYER_HXSYTAP2_ENABLE |
+                                           ATMEL_XLCDC_LAYER_HXSCCFG_ONE |
+                                           ATMEL_XLCDC_LAYER_HXSCTAP2_ENABLE);
+       }
 }
 
 static int atmel_hlcdc_plane_init_properties(struct atmel_hlcdc_plane *plane)