Skip to content

Commit c1b8e67

Browse files
drm: atmel-hlcdc: add vertical and horizontal scaling support for XLCDC
Update the LCDC_HEOCFG30 and LCDC_HEOCFG31 registers of XLCDC IP which supports vertical and horizontal scaling with Bilinear and Bicubic co-efficients taps for Chroma and Luma componenets of the Pixel. Signed-off-by: Manikandan Muralidharan <manikandan.m@microchip.com>
1 parent f386b53 commit c1b8e67

3 files changed

Lines changed: 26 additions & 0 deletions

File tree

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -541,6 +541,8 @@ static const struct atmel_hlcdc_layer_desc atmel_xlcdc_sam9x75_layers[] = {
541541
.general_config = 12,
542542
.csc = 16,
543543
.scaler_config = 23,
544+
.vxs_config = 30,
545+
.hxs_config = 31,
544546
},
545547
.clut_offset = 0x1300,
546548
},

drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,8 @@
198198
* @disc_pos: discard area position register
199199
* @disc_size: discard area size register
200200
* @csc: color space conversion register
201+
* @vxs_config: vertical scalar filter taps control register
202+
* @hxs_config: horizontal scalar filter taps control register
201203
*/
202204
struct atmel_hlcdc_layer_cfg_layout {
203205
int xstride[ATMEL_HLCDC_LAYER_MAX_PLANES];
@@ -217,6 +219,8 @@ struct atmel_hlcdc_layer_cfg_layout {
217219
int disc_pos;
218220
int disc_size;
219221
int csc;
222+
int vxs_config;
223+
int hxs_config;
220224
};
221225

222226
struct atmel_hlcdc_plane_state;

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

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -966,6 +966,26 @@ static void xlcdc_csc_init(struct atmel_hlcdc_plane *plane,
966966
desc->layout.csc + i,
967967
xlcdc_csc_coeffs[i]);
968968
}
969+
970+
if (desc->layout.vxs_config && desc->layout.hxs_config) {
971+
/*
972+
* Updating vxs.config and hxs.config fixes the
973+
* Green Color Issue in SAM9X7 EGT Video Player App
974+
*/
975+
atmel_hlcdc_layer_write_cfg(&plane->layer,
976+
desc->layout.vxs_config,
977+
ATMEL_XLCDC_LAYER_VXSYCFG_ONE |
978+
ATMEL_XLCDC_LAYER_VXSYTAP2_ENABLE |
979+
ATMEL_XLCDC_LAYER_VXSCCFG_ONE |
980+
ATMEL_XLCDC_LAYER_VXSCTAP2_ENABLE);
981+
982+
atmel_hlcdc_layer_write_cfg(&plane->layer,
983+
desc->layout.hxs_config,
984+
ATMEL_XLCDC_LAYER_HXSYCFG_ONE |
985+
ATMEL_XLCDC_LAYER_HXSYTAP2_ENABLE |
986+
ATMEL_XLCDC_LAYER_HXSCCFG_ONE |
987+
ATMEL_XLCDC_LAYER_HXSCTAP2_ENABLE);
988+
}
969989
}
970990

971991
static int atmel_hlcdc_plane_init_properties(struct atmel_hlcdc_plane *plane)

0 commit comments

Comments
 (0)