Skip to contentSkip to conversation

drm/gma500: Fix direction check in psb_accel_2d_copy()

PATCH In review Denis Efremov 2 participants 2 messages Jun 22, 2020 – Jun 23, 2020

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

PATCH 1/1 drm/gma500: Fix direction check in psb_accel_2d_copy()

psb_accel_2d_copy() checks direction PSB_2D_COPYORDER_BR2TL twice. Based on psb_accel_2d_copy_direction() results, PSB_2D_COPYORDER_TL2BR should be checked instead in the second direction check.

Fixes 4d8d096e9ae8 ("gma500: introduce the framebuffer support code")
---
 drivers/gpu/drm/gma500/accel_2d.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/gma500/accel_2d.c +2 -2
index adc0507545bf..8dc86aac54d2 100644
@@ -179,8 +179,8 @@ static int psb_accel_2d_copy(struct drm_psb_private *dev_priv,
 		src_x += size_x - 1;
 		dst_x += size_x - 1;
 	}
-	if (direction == PSB_2D_COPYORDER_BR2TL ||
-	    direction == PSB_2D_COPYORDER_BL2TR) {
+	if (direction == PSB_2D_COPYORDER_BL2TR ||
+	    direction == PSB_2D_COPYORDER_TL2BR) {
 		src_y += size_y - 1;
 		dst_y += size_y - 1;
 	}
Signature · 1 line
2.26.2
maintainer
#1 lore raw
Quoted 17 lines · Denis Efremov

psb_accel_2d_copy() checks direction PSB_2D_COPYORDER_BR2TL twice. Based on psb_accel_2d_copy_direction() results, PSB_2D_COPYORDER_TL2BR should be checked instead in the second direction check.

Fixes 4d8d096e9ae8 ("gma500: introduce the framebuffer support code")
---
 drivers/gpu/drm/gma500/accel_2d.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/gma500/accel_2d.c +0 -0
index adc0507545bf..8dc86aac54d2 100644

drivers/gpu/drm/gma500/accel_2d.c static int psb_accel_2d_copy(struct drm_psb_private *dev_priv, · line 183

Quoted 7 lines
drivers/gpu/drm/gma500/accel_2d.c +2 -2
@@ -179,8 +179,8 @@ static int psb_accel_2d_copy(struct drm_psb_private *dev_priv,
                src_x += size_x - 1;
                dst_x += size_x - 1;
        }
-       if (direction == PSB_2D_COPYORDER_BR2TL ||
-           direction == PSB_2D_COPYORDER_BL2TR) {
+       if (direction == PSB_2D_COPYORDER_BL2TR ||
+           direction == PSB_2D_COPYORDER_TL2BR) {

Hi Denis,

Sorry, I don't follow. The code seems already correct to me.

src_x and dst_x gets adjusted when going from right to left src_y and dst_y gets adjusted when going from bottom to top.

PSB_2D_COPYORDER_TL2BR needs no adjustment because it is the normal blit direction.

Thanks
Patrik

Quoted 6 lines
drivers/gpu/drm/gma500/accel_2d.c +0 -1
                src_y += size_y - 1;
                dst_y += size_y - 1;
        }
--

2.26.2

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