]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
drm: atmel-hlcdc: update the LCDC_ATTRE register in plane atomic_disable
authorManikandan Muralidharan <manikandan.m@microchip.com>
Mon, 14 Oct 2024 06:46:44 +0000 (12:16 +0530)
committerManikandan Muralidharan <manikandan.m@microchip.com>
Tue, 14 Oct 2025 08:53:00 +0000 (14:23 +0530)
update the LCDC_ATTRE register in drm plane atomic_disable to handle
the configuration changes of each layer when a plane is disabled.

Reviewed-by: Nicolas Ferre <nicolas.ferre@microchip.com>
Link: https://lore.kernel.org/r/20241014064644.292943-1-manikandan.m@microchip.com
Signed-off-by: Manikandan Muralidharan <manikandan.m@microchip.com>
drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.h
drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c

index e1a0bb24b5111038c56b3a0dbbe8447f86e7205f..53d47f01db0bd4d906b73f9f2a46f2ef7326d8c6 100644 (file)
@@ -378,7 +378,8 @@ struct atmel_lcdc_dc_ops {
        void (*lcdc_update_buffers)(struct atmel_hlcdc_plane *plane,
                                    struct atmel_hlcdc_plane_state *state,
                                    u32 sr, int i);
-       void (*lcdc_atomic_disable)(struct atmel_hlcdc_plane *plane);
+       void (*lcdc_atomic_disable)(struct atmel_hlcdc_plane *plane,
+                                   struct atmel_hlcdc_dc *dc);
        void (*lcdc_update_general_settings)(struct atmel_hlcdc_plane *plane,
                                             struct atmel_hlcdc_plane_state *state);
        void (*lcdc_atomic_update)(struct atmel_hlcdc_plane *plane,
index 6dd38018b47fea4e018ecbf6b7bab5770ca54ae6..eee042685559f9f218b2434ab587eff02bb022e5 100644 (file)
@@ -816,7 +816,8 @@ static int atmel_hlcdc_plane_atomic_check(struct drm_plane *p,
        return 0;
 }
 
-static void atmel_hlcdc_atomic_disable(struct atmel_hlcdc_plane *plane)
+static void atmel_hlcdc_atomic_disable(struct atmel_hlcdc_plane *plane,
+                                      struct atmel_hlcdc_dc *dc)
 {
        /* Disable interrupts */
        atmel_hlcdc_layer_write_reg(&plane->layer, ATMEL_HLCDC_LAYER_IDR,
@@ -832,7 +833,8 @@ static void atmel_hlcdc_atomic_disable(struct atmel_hlcdc_plane *plane)
        atmel_hlcdc_layer_read_reg(&plane->layer, ATMEL_HLCDC_LAYER_ISR);
 }
 
-static void atmel_xlcdc_atomic_disable(struct atmel_hlcdc_plane *plane)
+static void atmel_xlcdc_atomic_disable(struct atmel_hlcdc_plane *plane,
+                                      struct atmel_hlcdc_dc *dc)
 {
        /* Disable interrupts */
        atmel_hlcdc_layer_write_reg(&plane->layer, ATMEL_XLCDC_LAYER_IDR,
@@ -842,6 +844,15 @@ static void atmel_xlcdc_atomic_disable(struct atmel_hlcdc_plane *plane)
        atmel_hlcdc_layer_write_reg(&plane->layer,
                                    ATMEL_XLCDC_LAYER_ENR, 0);
 
+       /*
+        * Updating XLCDC_xxxCFGx, XLCDC_xxxFBA and XLCDC_xxxEN,
+        * (where xxx indicates each layer) requires writing one to the
+        * Update Attribute field for each layer in LCDC_ATTRE register for SAM9X7.
+        */
+       regmap_write(dc->hlcdc->regmap, ATMEL_XLCDC_ATTRE, ATMEL_XLCDC_BASE_UPDATE |
+                    ATMEL_XLCDC_OVR1_UPDATE | ATMEL_XLCDC_OVR3_UPDATE |
+                    ATMEL_XLCDC_HEO_UPDATE);
+
        /* Clear all pending interrupts */
        atmel_hlcdc_layer_read_reg(&plane->layer, ATMEL_XLCDC_LAYER_ISR);
 }
@@ -852,7 +863,7 @@ static void atmel_hlcdc_plane_atomic_disable(struct drm_plane *p,
        struct atmel_hlcdc_plane *plane = drm_plane_to_atmel_hlcdc_plane(p);
        struct atmel_hlcdc_dc *dc = plane->base.dev->dev_private;
 
-       dc->desc->ops->lcdc_atomic_disable(plane);
+       dc->desc->ops->lcdc_atomic_disable(plane, dc);
 }
 
 static void atmel_hlcdc_atomic_update(struct atmel_hlcdc_plane *plane,