Skip to contentSkip to conversation

Return from mtk_ovl_layer_config after mtk_ovl_layer_off

PATCH In review Mark Yacoub 3 participants 8 messages Dec 11, 2019 – Dec 25, 2019

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/2 Return from mtk_ovl_layer_config after mtk_ovl_layer_off

drm/mediatek: return if plane pending state is disabled.

If the plane pending state is disabled, call mtk_ovl_layer_off then return.
This guarantees that that the state is valid for all operations when the pending state is enabled.

To: CK Hu <[email protected]>
To: [email protected]

Cc Daniele Castagna <[email protected]>
Cc Philipp Zabel <[email protected]>
Cc David Airlie <[email protected]>
Cc Daniel Vetter <[email protected]>
Cc Matthias Brugger <[email protected]>
---
 drivers/gpu/drm/mediatek/mtk_disp_ovl.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
drivers/gpu/drm/mediatek/mtk_disp_ovl.c +4 -3
index 4a55bb6e2213..526b595eeff9 100644
@@ -260,8 +260,10 @@ static void mtk_ovl_layer_config(struct mtk_ddp_comp *comp, unsigned int idx,
 	unsigned int src_size = (pending->height << 16) | pending->width;
 	unsigned int con;
 
-	if (!pending->enable)
+	if (!pending->enable) {
 		mtk_ovl_layer_off(comp, idx);
+		return;
+	}
 
 	con = ovl_fmt_convert(ovl, fmt);
 	if (idx != 0)
@@ -283,8 +285,7 @@ static void mtk_ovl_layer_config(struct mtk_ddp_comp *comp, unsigned int idx,
 	writel_relaxed(offset, comp->regs + DISP_REG_OVL_OFFSET(idx));
 	writel_relaxed(addr, comp->regs + DISP_REG_OVL_ADDR(ovl, idx));
 
-	if (pending->enable)
-		mtk_ovl_layer_on(comp, idx);
+	mtk_ovl_layer_on(comp, idx);
 }
 
 static void mtk_ovl_bgclr_in_on(struct mtk_ddp_comp *comp)
Signature · 7 lines
2.24.0.525.g8f36a354ae-goog


_______________________________________________
Linux-mediatek mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-mediatek
#1 lore raw

PATCH 2/2 Turn off Alpha bit when plane format has no alpha

drm/mediatek: Add OVL_CON_ALPHA only when the plane format has_alpha.

This change enables XR24 format to be displayed as an overlay on top of the primary plane.

To: CK Hu <[email protected]>
To: [email protected]

Cc Daniele Castagna <[email protected]>
Cc Philipp Zabel <[email protected]>
Cc David Airlie <[email protected]>
Cc Daniel Vetter <[email protected]>
Cc Matthias Brugger <[email protected]>
---
 drivers/gpu/drm/mediatek/mtk_disp_ovl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/mediatek/mtk_disp_ovl.c +1 -1
index 526b595eeff9..a7851756dddf 100644
@@ -266,7 +266,7 @@ static void mtk_ovl_layer_config(struct mtk_ddp_comp *comp, unsigned int idx,
 	}
 
 	con = ovl_fmt_convert(ovl, fmt);
-	if (idx != 0)
+	if (state->base.fb->format->has_alpha)
 		con |= OVL_CON_AEN | OVL_CON_ALPHA;
 
 	if (pending->rotation & DRM_MODE_REFLECT_Y) {
Signature · 7 lines
2.24.0.525.g8f36a354ae-goog


_______________________________________________
Linux-mediatek mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-mediatek
Reviewed-by on v1 2/2
#2 lore raw

Re: [PATCH 2/2] Turn off Alpha bit when plane format has no alpha

Hi, Mark:

Quoted 4 lines · Mark Yacoub

drm/mediatek: Add OVL_CON_ALPHA only when the plane format has_alpha.

This change enables XR24 format to be displayed as an overlay on top of the primary plane.

Quoted 21 lines

To: CK Hu <[email protected]>
To: [email protected]

Cc Daniele Castagna <[email protected]>
Cc Philipp Zabel <[email protected]>
Cc David Airlie <[email protected]>
Cc Daniel Vetter <[email protected]>
Cc Matthias Brugger <[email protected]>
---
 drivers/gpu/drm/mediatek/mtk_disp_ovl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/mediatek/mtk_disp_ovl.c +0 -0
index 526b595eeff9..a7851756dddf 100644

drivers/gpu/drm/mediatek/mtk_disp_ovl.c static void mtk_ovl_layer_config(struct mtk_ddp_comp *comp, unsigned int idx, · line 272

Quoted 8 lines
drivers/gpu/drm/mediatek/mtk_disp_ovl.c +1 -1
@@ -266,7 +266,7 @@ static void mtk_ovl_layer_config(struct mtk_ddp_comp *comp, unsigned int idx,
 	}
 
 	con = ovl_fmt_convert(ovl, fmt);
-	if (idx != 0)
+	if (state->base.fb->format->has_alpha)
 		con |= OVL_CON_AEN | OVL_CON_ALPHA;
 
 	if (pending->rotation & DRM_MODE_REFLECT_Y) {

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

Reviewed-by on v1 1/2
#3 lore raw
In reply to Mark Yacoub

Hi, Mark:

Quoted 6 lines · Mark Yacoub

drm/mediatek: return if plane pending state is disabled.

If the plane pending state is disabled, call mtk_ovl_layer_off then return.
This guarantees that that the state is valid for all operations when the pending state is enabled.

Quoted 33 lines

To: CK Hu <[email protected]>
To: [email protected]

Cc Daniele Castagna <[email protected]>
Cc Philipp Zabel <[email protected]>
Cc David Airlie <[email protected]>
Cc Daniel Vetter <[email protected]>
Cc Matthias Brugger <[email protected]>
---
 drivers/gpu/drm/mediatek/mtk_disp_ovl.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
drivers/gpu/drm/mediatek/mtk_disp_ovl.c +3 -1
index 4a55bb6e2213..526b595eeff9 100644
@@ -260,8 +260,10 @@ static void mtk_ovl_layer_config(struct mtk_ddp_comp *comp, unsigned int idx,
 	unsigned int src_size = (pending->height << 16) | pending->width;
 	unsigned int con;
 
-	if (!pending->enable)
+	if (!pending->enable) {
 		mtk_ovl_layer_off(comp, idx);
+		return;
+	}
 
 	con = ovl_fmt_convert(ovl, fmt);
 	if (idx != 0)

drivers/gpu/drm/mediatek/mtk_disp_ovl.c static void mtk_ovl_layer_config(struct mtk_ddp_comp *comp, unsigned int idx, · line 291

Quoted 9 lines
drivers/gpu/drm/mediatek/mtk_disp_ovl.c +1 -2
@@ -283,8 +285,7 @@ static void mtk_ovl_layer_config(struct mtk_ddp_comp *comp, unsigned int idx,
 	writel_relaxed(offset, comp->regs + DISP_REG_OVL_OFFSET(idx));
 	writel_relaxed(addr, comp->regs + DISP_REG_OVL_ADDR(ovl, idx));
 
-	if (pending->enable)
-		mtk_ovl_layer_on(comp, idx);
+	mtk_ovl_layer_on(comp, idx);
 }
 
 static void mtk_ovl_bgclr_in_on(struct mtk_ddp_comp *comp)

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

Reviewed-by
#4 lore raw
Quoted 4 lines · CK Hu

Hi, Mark:

On Wed, 2019-12-11 at 10:49 -0500, Mark Yacoub wrote:

Quoted 9 lines
Quoted 6 lines

drm/mediatek: return if plane pending state is disabled.

If the plane pending state is disabled, call mtk_ovl_layer_off then return.
This guarantees that that the state is valid for all operations when the pending state is enabled.

Thanks for reviewing these patches, CK. When you apply them to your tree, could you please fixup the subjects with the correct prefixes?

Both patches are also

Sean

Quoted 41 lines
Quoted 41 lines

To: CK Hu <[email protected]>
To: [email protected]

Cc Daniele Castagna <[email protected]>
Cc Philipp Zabel <[email protected]>
Cc David Airlie <[email protected]>
Cc Daniel Vetter <[email protected]>
Cc Matthias Brugger <[email protected]>
---
 drivers/gpu/drm/mediatek/mtk_disp_ovl.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
drivers/gpu/drm/mediatek/mtk_disp_ovl.c +4 -3
index 4a55bb6e2213..526b595eeff9 100644
@@ -260,8 +260,10 @@ static void mtk_ovl_layer_config(struct mtk_ddp_comp *comp, unsigned int idx,
      unsigned int src_size = (pending->height << 16) | pending->width;
      unsigned int con;
 
-     if (!pending->enable)
+     if (!pending->enable) {
              mtk_ovl_layer_off(comp, idx);
+             return;
+     }
 
      con = ovl_fmt_convert(ovl, fmt);
      if (idx != 0)
@@ -283,8 +285,7 @@ static void mtk_ovl_layer_config(struct mtk_ddp_comp *comp, unsigned int idx,
      writel_relaxed(offset, comp->regs + DISP_REG_OVL_OFFSET(idx));
      writel_relaxed(addr, comp->regs + DISP_REG_OVL_ADDR(ovl, idx));
 
-     if (pending->enable)
-             mtk_ovl_layer_on(comp, idx);
+     mtk_ovl_layer_on(comp, idx);
 }
 
Quoted 6 lines

drivers/gpu/drm/mediatek/mtk_disp_ovl.c static void mtk_ovl_layer_config(struct mtk_ddp_comp *comp, unsigned int idx, · line 291

Quoted 1 line
drivers/gpu/drm/mediatek/mtk_disp_ovl.c +0 -0
 static void mtk_ovl_bgclr_in_on(struct mtk_ddp_comp *comp)

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#5 lore raw

Hi, Sean:

Quoted 12 lines · Sean Paul
Quoted 11 lines · CK Hu

Hi, Mark:

Quoted 6 lines · Mark Yacoub

drm/mediatek: return if plane pending state is disabled.

If the plane pending state is disabled, call mtk_ovl_layer_off then return.
This guarantees that that the state is valid for all operations when the pending state is enabled.

Quoted 5 lines
Quoted 2 lines

Thanks for reviewing these patches, CK. When you apply them to your tree, could you please fixup the subjects with the correct prefixes?

Thanks for your notice. I've already planed to do so.

Regards,
CK

Quoted 55 lines

Both patches are also

Sean

Quoted 41 lines
Quoted 41 lines

To: CK Hu <[email protected]>
To: [email protected]

Cc Daniele Castagna <[email protected]>
Cc Philipp Zabel <[email protected]>
Cc David Airlie <[email protected]>
Cc Daniel Vetter <[email protected]>
Cc Matthias Brugger <[email protected]>
---
 drivers/gpu/drm/mediatek/mtk_disp_ovl.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
drivers/gpu/drm/mediatek/mtk_disp_ovl.c +4 -3
index 4a55bb6e2213..526b595eeff9 100644
@@ -260,8 +260,10 @@ static void mtk_ovl_layer_config(struct mtk_ddp_comp *comp, unsigned int idx,
      unsigned int src_size = (pending->height << 16) | pending->width;
      unsigned int con;
 
-     if (!pending->enable)
+     if (!pending->enable) {
              mtk_ovl_layer_off(comp, idx);
+             return;
+     }
 
      con = ovl_fmt_convert(ovl, fmt);
      if (idx != 0)
@@ -283,8 +285,7 @@ static void mtk_ovl_layer_config(struct mtk_ddp_comp *comp, unsigned int idx,
      writel_relaxed(offset, comp->regs + DISP_REG_OVL_OFFSET(idx));
      writel_relaxed(addr, comp->regs + DISP_REG_OVL_ADDR(ovl, idx));
 
-     if (pending->enable)
-             mtk_ovl_layer_on(comp, idx);
+     mtk_ovl_layer_on(comp, idx);
 }
 
Quoted 6 lines

drivers/gpu/drm/mediatek/mtk_disp_ovl.c static void mtk_ovl_layer_config(struct mtk_ddp_comp *comp, unsigned int idx, · line 291

Quoted 1 line
drivers/gpu/drm/mediatek/mtk_disp_ovl.c +0 -0
 static void mtk_ovl_bgclr_in_on(struct mtk_ddp_comp *comp)

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

Quoted 4 lines

_______________________________________________
Linux-mediatek mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-mediatek

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#6 lore raw
In reply to Mark Yacoub

Hi, Mark:

Quoted 6 lines · Mark Yacoub

drm/mediatek: return if plane pending state is disabled.

If the plane pending state is disabled, call mtk_ovl_layer_off then return.
This guarantees that that the state is valid for all operations when the pending state is enabled.

For this series, applied to mediatek-drm-next-5.6 [1], thanks.

[1]
https://github.com/ckhu-mediatek/linux.git-tags/commits/mediatek-drm-next-5.6

Regards,
CK

Quoted 33 lines

To: CK Hu <[email protected]>
To: [email protected]

Cc Daniele Castagna <[email protected]>
Cc Philipp Zabel <[email protected]>
Cc David Airlie <[email protected]>
Cc Daniel Vetter <[email protected]>
Cc Matthias Brugger <[email protected]>
---
 drivers/gpu/drm/mediatek/mtk_disp_ovl.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
drivers/gpu/drm/mediatek/mtk_disp_ovl.c +3 -1
index 4a55bb6e2213..526b595eeff9 100644
@@ -260,8 +260,10 @@ static void mtk_ovl_layer_config(struct mtk_ddp_comp *comp, unsigned int idx,
 	unsigned int src_size = (pending->height << 16) | pending->width;
 	unsigned int con;
 
-	if (!pending->enable)
+	if (!pending->enable) {
 		mtk_ovl_layer_off(comp, idx);
+		return;
+	}
 
 	con = ovl_fmt_convert(ovl, fmt);
 	if (idx != 0)

drivers/gpu/drm/mediatek/mtk_disp_ovl.c static void mtk_ovl_layer_config(struct mtk_ddp_comp *comp, unsigned int idx, · line 291

Quoted 9 lines
drivers/gpu/drm/mediatek/mtk_disp_ovl.c +1 -2
@@ -283,8 +285,7 @@ static void mtk_ovl_layer_config(struct mtk_ddp_comp *comp, unsigned int idx,
 	writel_relaxed(offset, comp->regs + DISP_REG_OVL_OFFSET(idx));
 	writel_relaxed(addr, comp->regs + DISP_REG_OVL_ADDR(ovl, idx));
 
-	if (pending->enable)
-		mtk_ovl_layer_on(comp, idx);
+	mtk_ovl_layer_on(comp, idx);
 }
 
 static void mtk_ovl_bgclr_in_on(struct mtk_ddp_comp *comp)

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#7 lore raw

Thanks for the update!

Quoted 51 lines · CK Hu

Hi, Mark:

Quoted 6 lines · Mark Yacoub

drm/mediatek: return if plane pending state is disabled.

If the plane pending state is disabled, call mtk_ovl_layer_off then return.
This guarantees that that the state is valid for all operations when the pending state is enabled.

For this series, applied to mediatek-drm-next-5.6 [1], thanks.

[1]

https://github.com/ckhu-mediatek/linux.git-tags/commits/mediatek-drm-next-5.6

Regards,
CK

Quoted 12 lines

To: CK Hu <[email protected]>
To: [email protected]

Cc Daniele Castagna <[email protected]>
Cc Philipp Zabel <[email protected]>
Cc David Airlie <[email protected]>
Cc Daniel Vetter <[email protected]>
Cc Matthias Brugger <[email protected]>

Review

Quoted 5 lines
---
 drivers/gpu/drm/mediatek/mtk_disp_ovl.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
(quoted diff) +0 -0

b/drivers/gpu/drm/mediatek/mtk_disp_ovl.c

drivers/gpu/drm/mediatek/mtk_disp_ovl.c static void mtk_ovl_layer_config(struct

Quoted 4 lines

index 4a55bb6e2213..526b595eeff9 100644

drivers/gpu/drm/mediatek/mtk_disp_ovl.c +0 -0
@@ -260,8 +260,10 @@ static void mtk_ovl_layer_config(struct

mtk_ddp_comp *comp, unsigned int idx,

Quoted 9 lines
drivers/gpu/drm/mediatek/mtk_disp_ovl.c +3 -1
      unsigned int src_size = (pending->height << 16) | pending->width;
      unsigned int con;
 
-     if (!pending->enable)
+     if (!pending->enable) {
              mtk_ovl_layer_off(comp, idx);
+             return;
+     }
 
Quoted 15 lines

drivers/gpu/drm/mediatek/mtk_disp_ovl.c static void mtk_ovl_layer_config(struct mtk_ddp_comp

Quoted 3 lines
drivers/gpu/drm/mediatek/mtk_disp_ovl.c +0 -0
      con = ovl_fmt_convert(ovl, fmt);
      if (idx != 0)
@@ -283,8 +285,7 @@ static void mtk_ovl_layer_config(struct mtk_ddp_comp

*comp, unsigned int idx,

Quoted 9 lines
drivers/gpu/drm/mediatek/mtk_disp_ovl.c +1 -2
      writel_relaxed(offset, comp->regs + DISP_REG_OVL_OFFSET(idx));
      writel_relaxed(addr, comp->regs + DISP_REG_OVL_ADDR(ovl, idx));
 
-     if (pending->enable)
-             mtk_ovl_layer_on(comp, idx);
+     mtk_ovl_layer_on(comp, idx);
 }
 
 static void mtk_ovl_bgclr_in_on(struct mtk_ddp_comp *comp)

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel