From patchwork Mon Jun 22 20:45:37 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Denis Efremov (Oracle)" X-Patchwork-Id: 11619977 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 3442090 for ; Tue, 23 Jun 2020 07:49:08 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 1D1D32073E for ; Tue, 23 Jun 2020 07:49:08 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1D1D32073E Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linux.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 786D76E959; Tue, 23 Jun 2020 07:48:58 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-lj1-f194.google.com (mail-lj1-f194.google.com [209.85.208.194]) by gabe.freedesktop.org (Postfix) with ESMTPS id E82136E918 for ; Mon, 22 Jun 2020 20:45:54 +0000 (UTC) Received: by mail-lj1-f194.google.com with SMTP id n23so20888439ljh.7 for ; 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=SXExCqIrWJkwjJ3VqRMJBWugEwSoRjMW14HKc+5FDK4dplQ6Ma4HwsT32lHBA2Fueq DcXD+NrjDVbBcttfhB75BYMfRY6M9tLheaIQ1/xEEWusHNMl8wt3DJNvpnPu/enW3NDB eksBUvH/V6p+Qu0u70v0wTpvVCH13GOfzdDUlxog7m8TS5qZSDOi4iuk7eaoG+4z0IcE bkwVUGbSxCBXn8LPALnCjYk1QD8drWW+DH7+ezxlUiL/4m+U3akW+TZggTsUhpzX3/+X HG3/i/9bmiwSEG7bKFu2KpnBERhCP0GzIT0n7m4PTXmkyO3iQNQ7begYm8ILNEPskSO2 1k1Q== X-Gm-Message-State: AOAM532ZE9lyLzb+ND51izb2w19ktYbFLJjV4wFXJItJWeUHH3M6GDEY Vgi002QrbXzeLA+jX/IhR7E= X-Google-Smtp-Source: ABdhPJwzB6UHwxJ1YrbwAUcm9GmVOZcbiVSJ0aSHpBEom2b+5l+RnXEAmCW0zZ8jMyLXZ9LGfBSzcA== 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 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 X-Mailman-Approved-At: Tue, 23 Jun 2020 07:48:47 +0000 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: stable@vger.kernel.org, dri-devel@lists.freedesktop.org, Denis Efremov , linux-kernel@vger.kernel.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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; }