From: Jerome Glisse Subject: [PATCH] drm/radeon/kms: r600 fix color buffer pitch check Date: Mon, 26 Apr 2010 11:36:16 +0200 Message-ID: <1272274576-3068-1-git-send-email-jglisse@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from protox.org (nox2.protox.org [95.130.11.66]) by gabe.freedesktop.org (Postfix) with ESMTP id 7BC7B9E752 for ; Mon, 26 Apr 2010 02:36:29 -0700 (PDT) List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dri-devel-bounces+sf-dri-devel=m.gmane.org@lists.freedesktop.org Errors-To: dri-devel-bounces+sf-dri-devel=m.gmane.org@lists.freedesktop.org To: airlied@gmail.com Cc: Jerome Glisse , stable , dri-devel@lists.freedesktop.org List-Id: dri-devel@lists.freedesktop.org Color buffer pitch need to be 64bits aligned not 64bytes. This patch correct the cs checker. Signed-off-by: Jerome Glisse Cc: stable --- drivers/gpu/drm/radeon/r600_cs.c | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/radeon/r600_cs.c b/drivers/gpu/drm/radeon/r600_cs.c index c39c1bc..865144e 100644 --- a/drivers/gpu/drm/radeon/r600_cs.c +++ b/drivers/gpu/drm/radeon/r600_cs.c @@ -193,14 +193,14 @@ static inline int r600_cs_track_validate_cb(struct radeon_cs_parser *p, int i) switch (G_0280A0_ARRAY_MODE(track->cb_color_info[i])) { case V_0280A0_ARRAY_LINEAR_GENERAL: case V_0280A0_ARRAY_LINEAR_ALIGNED: - if (pitch & 0x3f) { + if (pitch & 0x3) { dev_warn(p->dev, "%s:%d cb pitch (%d x %d = %d) invalid\n", __func__, __LINE__, pitch, bpe, pitch * bpe); return -EINVAL; } - if ((pitch * bpe) & (track->group_size - 1)) { - dev_warn(p->dev, "%s:%d cb pitch (%d) invalid\n", - __func__, __LINE__, pitch); + if ((pitch * bpe * 8) & (track->group_size - 1)) { + dev_warn(p->dev, "%s:%d cb pitch (%d x %d = %d) %d invalid\n", + __func__, __LINE__, pitch, bpe, pitch * bpe, track->group_size); return -EINVAL; } break; -- 1.7.0.1