Skip to contentSkip to conversation

drm: atmel-hlcdc: update the LCDC_ATTRE register in plane atomic_disable

PATCH In review Manikandan Muralidharan 2 participants 4 messages Oct 14, 2024 – Oct 14, 2025

Subsystems (4)
lore
Share & tools
lore

Manikandan Muralidharan

author maintainer
#0 lore raw

PATCH 1/1 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 changes of each layer when a plane is disabled.

---
 drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.h    |  3 ++-
 drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c | 17 ++++++++++++++---
 2 files changed, 16 insertions(+), 4 deletions(-)
drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.h +2 -1
index e1a0bb24b511..53d47f01db0b 100644
@@ -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,
drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c +14 -3
index 4a7ba0918eca..4bcaf2cd7672 100644
@@ -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,
Signature · 1 line
2.25.1
maintainer Reviewed-by on v1 1/1
#1 lore raw
Quoted 4 lines · Manikandan Muralidharan

update the LCDC_ATTRE register in drm plane atomic_disable to handle the configuration changes of each layer when a plane is disabled.

Thanks Mani. Best regards,
Nicolas

Quoted 68 lines
---
  drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.h    |  3 ++-
  drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c | 17 ++++++++++++++---
  2 files changed, 16 insertions(+), 4 deletions(-)
drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.h +2 -1
index e1a0bb24b511..53d47f01db0b 100644
@@ -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,
drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c +14 -3
index 4a7ba0918eca..4bcaf2cd7672 100644
@@ -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,
author maintainer
#2 lore raw

Hi,

A gentle reminder to merge this patch. Let me know if any further changes are needed.

Quoted 85 lines · Nicolas Ferre
Quoted 4 lines · Manikandan Muralidharan

update the LCDC_ATTRE register in drm plane atomic_disable to handle the configuration changes of each layer when a plane is disabled.

Thanks Mani. Best regards,
  Nicolas

Quoted 73 lines

---
  drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.h    |  3 ++- drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c | 17 ++++++++++++++---

  2 files changed, 16 insertions(+), 4 deletions(-)
drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.h +2 -1
index e1a0bb24b511..53d47f01db0b 100644
@@ -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,

drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c +8 -2
index 4a7ba0918eca..4bcaf2cd7672 100644
@@ -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); }

drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c +0 -0
@@ -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,

Signature · 2 lines
Thanks and Regards,
Manikandan M.
author maintainer Applied
#3 lore raw
In reply to Nicolas Ferre
Quoted 11 lines · Nicolas Ferre
Quoted 4 lines · Manikandan Muralidharan

update the LCDC_ATTRE register in drm plane atomic_disable to handle the configuration changes of each layer when a plane is disabled.

Thanks Mani. Best regards,
  Nicolas

Applied to drm-misc-next.

Signature · 2 lines
Thanks and Regards,
Manikandan M.