Skip to content

Commit b9c70e7

Browse files
drm: atmel-hlcdc: update the LCDC_ATTRE register in plane atomic_disable
update the LCDC_ATTRE register in drm plane atomic_disable to handle the configuration register changes of each layer when a plane is disabled. Signed-off-by: Manikandan Muralidharan <manikandan.m@microchip.com> Reviewed-by: Nicolas Ferre <nicolas.ferre@microchip.com>
1 parent 4329847 commit b9c70e7

2 files changed

Lines changed: 16 additions & 4 deletions

File tree

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,8 @@ struct atmel_lcdc_dc_ops {
356356
void (*update_lcdc_buffers)(struct atmel_hlcdc_plane *plane,
357357
struct atmel_hlcdc_plane_state *state,
358358
u32 sr, int i);
359-
void (*lcdc_atomic_disable)(struct atmel_hlcdc_plane *plane);
359+
void (*lcdc_atomic_disable)(struct atmel_hlcdc_plane *plane,
360+
struct atmel_hlcdc_dc *dc);
360361
void (*lcdc_update_general_settings)(struct atmel_hlcdc_plane *plane,
361362
struct atmel_hlcdc_plane_state *state);
362363
void (*lcdc_atomic_update)(struct atmel_hlcdc_plane *plane,

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

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -837,7 +837,8 @@ static int atmel_hlcdc_plane_atomic_check(struct drm_plane *p,
837837
return 0;
838838
}
839839

840-
static void hlcdc_atomic_disable(struct atmel_hlcdc_plane *plane)
840+
static void hlcdc_atomic_disable(struct atmel_hlcdc_plane *plane,
841+
struct atmel_hlcdc_dc *dc)
841842
{
842843
/* Disable interrupts */
843844
atmel_hlcdc_layer_write_reg(&plane->layer, ATMEL_HLCDC_LAYER_IDR,
@@ -853,7 +854,8 @@ static void hlcdc_atomic_disable(struct atmel_hlcdc_plane *plane)
853854
atmel_hlcdc_layer_read_reg(&plane->layer, ATMEL_HLCDC_LAYER_ISR);
854855
}
855856

856-
static void xlcdc_atomic_disable(struct atmel_hlcdc_plane *plane)
857+
static void xlcdc_atomic_disable(struct atmel_hlcdc_plane *plane,
858+
struct atmel_hlcdc_dc *dc)
857859
{
858860
/* Disable interrupts */
859861
atmel_hlcdc_layer_write_reg(&plane->layer, ATMEL_XLCDC_LAYER_IDR,
@@ -863,6 +865,15 @@ static void xlcdc_atomic_disable(struct atmel_hlcdc_plane *plane)
863865
atmel_hlcdc_layer_write_reg(&plane->layer,
864866
ATMEL_XLCDC_LAYER_ENR, 0);
865867

868+
/*
869+
* Updating XLCDC_xxxCFGx, XLCDC_xxxFBA and XLCDC_xxxEN,
870+
* (where xxx indicates each layer) requires writing one to the
871+
* Update Attribute field for each layer in LCDC_ATTRE register for SAM9X7.
872+
*/
873+
regmap_write(dc->hlcdc->regmap, ATMEL_XLCDC_ATTRE, ATMEL_XLCDC_BASE_UPDATE |
874+
ATMEL_XLCDC_OVR1_UPDATE | ATMEL_XLCDC_OVR3_UPDATE |
875+
ATMEL_XLCDC_HEO_UPDATE);
876+
866877
/* Clear all pending interrupts */
867878
atmel_hlcdc_layer_read_reg(&plane->layer, ATMEL_XLCDC_LAYER_ISR);
868879
}
@@ -873,7 +884,7 @@ static void atmel_hlcdc_plane_atomic_disable(struct drm_plane *p,
873884
struct atmel_hlcdc_plane *plane = drm_plane_to_atmel_hlcdc_plane(p);
874885
struct atmel_hlcdc_dc *dc = plane->base.dev->dev_private;
875886

876-
dc->desc->ops->lcdc_atomic_disable(plane);
887+
dc->desc->ops->lcdc_atomic_disable(plane, dc);
877888
}
878889

879890
static void hlcdc_atomic_update(struct atmel_hlcdc_plane *plane,

0 commit comments

Comments
 (0)