Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp3054572ybt; Mon, 22 Jun 2020 13:50:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzI1dXHD94XGYBiadCxqEqAV2lZkGe5mneLnOW8PhQWEw31IbrJMqGKHhTmhUrEzU4hiVbI X-Received: by 2002:a50:ee01:: with SMTP id g1mr18136654eds.44.1592859005615; Mon, 22 Jun 2020 13:50:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592859005; cv=none; d=google.com; s=arc-20160816; b=1Lj/4IhGaMMBBnn78Kbw5usRRdSd+3mY1bhqpyT8zJT4WhkA/gNxqYDfa1z+Ea9j+H y31vFC1AuTnyFurmC0Ed22k7EfPCMuZtZtuadBGLM5Wlzh7nZv2BDZFaiwZbroJMAISa LadyjUkZZzXUBEKx3X+Dr74JKd6+GGwf4GYhl3q9xaIyXSoE+PJvs5Za8MvVVRl+ifxa fgQ2gioJX/1O/KDj3a2uup0SVODNm7DO884ZGiAw4CmKL8dFKELJdnnfY9kUq2+w8oQu 3+KaxC5lTXSIspzdhzkIcnP4XVPRxvbtS5273y5rHT24ATKV1oP7KEt/rPiPy2Iyp9KY OTUA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=vLDSApuJ0v81hqVWKGC7U58iC5Y/D0ks2PXVy/bBVsQ=; b=lLNYRXwfRQfe5EL9EwTgbSISBF1rS37vvr1FO4z8fkGtMqYi76EZ+VO2XMhqw8JjFd oD8jkpuigBldTp0hmhrviLE3P8ePDwpJFBHcwX9thpn2lNj4mmFPvp1XNSKqCl4ySIuX XRbzieSvTN+jBT5lDQPje1/Vh3U4epKmBERPfWSrlq1OFLpY+xjolZSG2De329/0L3Ev wg4Yp1WfsNusyoUQ24SNAB9WCTimP9XhmbtGsM6ndqrAU4Bt6HSxIIyqUMgXjh2nYYk5 xf9aRhrONzMnAlCMbYfMp4J/UQa0qIWpAtJEBoOCujRWJkik+y0cm6EIRmG1yrr9GCSR 1wMw== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l6si2970105ejx.493.2020.06.22.13.49.42; Mon, 22 Jun 2020 13:50:05 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728686AbgFVUp4 (ORCPT + 99 others); Mon, 22 Jun 2020 16:45:56 -0400 Received: from mail-lj1-f196.google.com ([209.85.208.196]:41695 "EHLO mail-lj1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728490AbgFVUp4 (ORCPT ); Mon, 22 Jun 2020 16:45:56 -0400 Received: by mail-lj1-f196.google.com with SMTP id 9so20939820ljc.8; Mon, 22 Jun 2020 13:45:54 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=vLDSApuJ0v81hqVWKGC7U58iC5Y/D0ks2PXVy/bBVsQ=; b=FiYtyG5untV4L2JXWPRu6KC0XcsQkGXsgN0+mJrmDW1FxdFAv0PKHylmeCL/D3bnqv OEIODFq7l3xIq/4Lppb94Qa0mUchDq3RVFUCtEL3x1obpntPHVPkKvW1VXY0zsnbpXn5 Q2sJz8ySSRnM5iD5IlS4SkB/bXIq2E4NI2Vx1idcfDfMsyeTRMwhKp4KF3KljL42XJ70 VBW/riOUPO20fZ9CSPil3YYisGuWCwVff4wuNgLcKPZfQ/0WOQcvE/Vuw7TbxFMvAeEk 4omYbj8CRWw+HpdOr/WHct7oojzspZN16u6xFfbUp/AHjZrQ+kItA+SvYnpZS/W35G61 U3xg== X-Gm-Message-State: AOAM531qZSZQSJkDpm414j2SpCBfvKNW8s7F4SKRpDjhLrr9Js9QmzSi +/L6OEEAvRMqRxSmHbOdJDA= X-Received: by 2002:a2e:96cd:: with SMTP id d13mr9076836ljj.251.1592858753330; Mon, 22 Jun 2020 13:45:53 -0700 (PDT) Received: from localhost.localdomain (broadband-37-110-38-130.ip.moscow.rt.ru. [37.110.38.130]) by smtp.googlemail.com with ESMTPSA id j18sm3691359lfj.68.2020.06.22.13.45.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jun 2020 13:45:52 -0700 (PDT) From: Denis Efremov To: Alan Cox , Patrik Jakobsson , David Airlie , Daniel Vetter Cc: Denis Efremov , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org Subject: [PATCH] drm/gma500: Fix direction check in psb_accel_2d_copy() Date: Mon, 22 Jun 2020 23:45:37 +0300 Message-Id: <20200622204537.26792-1-efremov@linux.com> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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) { src_y += size_y - 1; dst_y += size_y - 1; } -- 2.26.2