All of lore.kernel.org
 help / color / mirror / Atom feed
From: Patrik Jakobsson <patrik.r.jakobsson@gmail.com>
To: Denis Efremov <efremov@linux.com>
Cc: Alan Cox <alan@linux.intel.com>, David Airlie <airlied@linux.ie>,
	Daniel Vetter <daniel@ffwll.ch>,
	dri-devel <dri-devel@lists.freedesktop.org>,
	linux-kernel <linux-kernel@vger.kernel.org>,
	stable@vger.kernel.org
Subject: Re: [PATCH] drm/gma500: Fix direction check in psb_accel_2d_copy()
Date: Tue, 23 Jun 2020 18:35:40 +0200	[thread overview]
Message-ID: <CAMeQTsYAomJnjc6eVnDxQL+FC3nG+n1ZDqUPGgDpU=tt9d+JMA@mail.gmail.com> (raw)
In-Reply-To: <20200622204537.26792-1-efremov@linux.com>

On Mon, Jun 22, 2020 at 10:45 PM Denis Efremov <efremov@linux.com> wrote:
>
> 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")
> Cc: stable@vger.kernel.org
> Signed-off-by: Denis Efremov <efremov@linux.com>
> ---
>  drivers/gpu/drm/gma500/accel_2d.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/gma500/accel_2d.c b/drivers/gpu/drm/gma500/accel_2d.c
> index adc0507545bf..8dc86aac54d2 100644
> --- a/drivers/gpu/drm/gma500/accel_2d.c
> +++ b/drivers/gpu/drm/gma500/accel_2d.c
> @@ -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

>                 src_y += size_y - 1;
>                 dst_y += size_y - 1;
>         }
> --
> 2.26.2
>

WARNING: multiple messages have this Message-ID (diff)
From: Patrik Jakobsson <patrik.r.jakobsson@gmail.com>
To: Denis Efremov <efremov@linux.com>
Cc: David Airlie <airlied@linux.ie>,
	linux-kernel <linux-kernel@vger.kernel.org>,
	stable@vger.kernel.org,
	dri-devel <dri-devel@lists.freedesktop.org>,
	Alan Cox <alan@linux.intel.com>
Subject: Re: [PATCH] drm/gma500: Fix direction check in psb_accel_2d_copy()
Date: Tue, 23 Jun 2020 18:35:40 +0200	[thread overview]
Message-ID: <CAMeQTsYAomJnjc6eVnDxQL+FC3nG+n1ZDqUPGgDpU=tt9d+JMA@mail.gmail.com> (raw)
In-Reply-To: <20200622204537.26792-1-efremov@linux.com>

On Mon, Jun 22, 2020 at 10:45 PM Denis Efremov <efremov@linux.com> wrote:
>
> 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")
> Cc: stable@vger.kernel.org
> Signed-off-by: Denis Efremov <efremov@linux.com>
> ---
>  drivers/gpu/drm/gma500/accel_2d.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/gma500/accel_2d.c b/drivers/gpu/drm/gma500/accel_2d.c
> index adc0507545bf..8dc86aac54d2 100644
> --- a/drivers/gpu/drm/gma500/accel_2d.c
> +++ b/drivers/gpu/drm/gma500/accel_2d.c
> @@ -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

>                 src_y += size_y - 1;
>                 dst_y += size_y - 1;
>         }
> --
> 2.26.2
>
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2020-06-23 16:35 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-22 20:45 [PATCH] drm/gma500: Fix direction check in psb_accel_2d_copy() Denis Efremov
2020-06-22 20:45 ` Denis Efremov
2020-06-23 16:35 ` Patrik Jakobsson [this message]
2020-06-23 16:35   ` Patrik Jakobsson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAMeQTsYAomJnjc6eVnDxQL+FC3nG+n1ZDqUPGgDpU=tt9d+JMA@mail.gmail.com' \
    --to=patrik.r.jakobsson@gmail.com \
    --cc=airlied@linux.ie \
    --cc=alan@linux.intel.com \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=efremov@linux.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.