Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp3742225ybt; Tue, 23 Jun 2020 09:36:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzdmXp+B4zW0hSytzOWdPRkMhK+jLoM85tAGQHKkwoq4arFP0tki0/iRcto9aUrP5l9oCYZ X-Received: by 2002:a17:906:1496:: with SMTP id x22mr20178096ejc.161.1592930186230; Tue, 23 Jun 2020 09:36:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592930186; cv=none; d=google.com; s=arc-20160816; b=pzYyVCNdH+c2SX+kOb+xK968t5pL4OKInzuPzNa3XvtpbMzXoXWXhohhalon9xNpeq dgDgIKIOqBU4Vt284AsNMDXIKppqY0zMBAdapkv17B8C17BhGowOTszATGEP7skNYD88 8ATTYd/5VOeNScNOGH+IRVXz79nFH763x+T6oQcKwOcfpOypCug5ugRWWhpyqhC7Y8MC UWdGgM18c2I2zdz4QzdRAix9t9AVbbKvpVd4qhpoGIhsPdVwwT0o24oyJVp/EldJ0tko R/JGetdyhHJkVy8Henp3z/IGiNvr0B10nvysdjMKEX+NU4iy6CtQxi6xNanMX9PnAtKC saHg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=fEg6d25UGfcPYY7V+Hk1VnYd/BQrvpNa49hlVGHxeMA=; b=D9ieDe9YplBEYsTCyy8fWTLFQFyqo02dv8sn7uO6bJBtEb/JiMUkCyF+C9UyDUR1/6 9+xrfHdbPhUT/zY+UTvN6FWDDUgQcqwX6dvAQRCXPp6iumUIlnRaZGkf2nTKbIi0w07z rieL+g7YFbhIwIIGrX0pa2/YA8liyH5hB/xKe+p/NjBzsTu/uQy5A3uEqIuflbBq7JUD u5ZdC5t7JsdnqSxvauz/FbvpL0Lj2TXXCV8wK8AvyFtilw5A6ZLbOF4Lg0+pXYSS8KHv s2win8wpUlo9KhZgeJJsrhVqmnb2ZuKIweZCwHgB7/CRmupZz4H04VzpaV/TxIVwxKIH uNJg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="e5UWG/uq"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w16si11166244ejn.715.2020.06.23.09.36.03; Tue, 23 Jun 2020 09:36:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="e5UWG/uq"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732690AbgFWQfy (ORCPT + 99 others); Tue, 23 Jun 2020 12:35:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45898 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729481AbgFWQfx (ORCPT ); Tue, 23 Jun 2020 12:35:53 -0400 Received: from mail-lj1-x244.google.com (mail-lj1-x244.google.com [IPv6:2a00:1450:4864:20::244]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 904D5C061573; Tue, 23 Jun 2020 09:35:52 -0700 (PDT) Received: by mail-lj1-x244.google.com with SMTP id a9so24161731ljn.6; Tue, 23 Jun 2020 09:35:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=fEg6d25UGfcPYY7V+Hk1VnYd/BQrvpNa49hlVGHxeMA=; b=e5UWG/uq7VlzVdXxW7H1FtNuYg9CuE0jZ+f195RVA75WoKMrBfXE99E0IyqjmT6B93 CVUcGT3+r/Y7uGMiJXh8wn7+nX1Juwa+379k82vm9KCjn1MtgLexvNJW8KKAS83NdTfq bvEzIPJi0wmZ2GKpd5bvXa3XLMLI1ms5+Ppn2c/m/oRNuLtUTDaWUt6zQIp6oMTey0fH xHzwX1EmVIu6qDUGQkwT/NrSTVq8+IOgAwnkJt5Qe2uIx++GLGEY7OZEPSsjvftBl0Te R+Xe18DrNiV/eJ2GI5BYFGNnKTlCBjirbxqWeXJuH61OlvJ2WQXaF9VDvMzhOt8L4rVN iPJg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=fEg6d25UGfcPYY7V+Hk1VnYd/BQrvpNa49hlVGHxeMA=; b=Va3slSk2tX16JRkFtYQdw+WUuagnyLq3SPZ/xjkWdsIGimxCOa7U3ZXVzw0KBr05GA /tQ/a5ktoFx2YxUspvQ5evqoCTakZno8khNXb4X2qaYb2AR0k6mmxtbwSSCevB2LUKmz oZ2lm8nL5O8iB2Xz3lfX43xLDXjjeRxrVqnvofjnMbSbF4ihKsI2b2z9TM95M3f/ERdy UITsz0OQagF34HSIqZRwbjteWfo3SRRyw1uxCLNJWGCt3p5a/hWwbCVB0+RNzs62sNI4 wMO5Z1s1iCanbmLxkUDYfSPSxbIALY/XdEhpOEYvClKwynNNiZ4yn4VS9xx1HTb05Mky +bow== X-Gm-Message-State: AOAM5328mJ5Che2Dxo6ZgGQeoKYdt9JFR16lFVpVNNlodfcIZ/rBbW2k I4i++Gj3Ui3XQMXbCwmBKp7Ibgu+aiav5XdN2PcwUgD/i6Q= X-Received: by 2002:a2e:8783:: with SMTP id n3mr6787289lji.224.1592930151040; Tue, 23 Jun 2020 09:35:51 -0700 (PDT) MIME-Version: 1.0 References: <20200622204537.26792-1-efremov@linux.com> In-Reply-To: <20200622204537.26792-1-efremov@linux.com> From: Patrik Jakobsson Date: Tue, 23 Jun 2020 18:35:40 +0200 Message-ID: Subject: Re: [PATCH] drm/gma500: Fix direction check in psb_accel_2d_copy() To: Denis Efremov Cc: Alan Cox , David Airlie , Daniel Vetter , dri-devel , linux-kernel , stable@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jun 22, 2020 at 10:45 PM Denis Efremov 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 > --- > 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 >