From patchwork Thu Feb 11 03:56:41 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matt Turner X-Patchwork-Id: 78636 Received: from lists.sourceforge.net (lists.sourceforge.net [216.34.181.88]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o1B3qqeQ019215 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Thu, 11 Feb 2010 03:53:30 GMT Received: from localhost ([127.0.0.1] helo=sfs-ml-1.v29.ch3.sourceforge.com) by sfs-ml-1.v29.ch3.sourceforge.com with esmtp (Exim 4.69) (envelope-from ) id 1NfQ5O-00044G-F5; Thu, 11 Feb 2010 03:51:26 +0000 Received: from sfi-mx-2.v28.ch3.sourceforge.com ([172.29.28.122] helo=mx.sourceforge.net) by sfs-ml-1.v29.ch3.sourceforge.com with esmtp (Exim 4.69) (envelope-from ) id 1NfQ5M-000441-IX for dri-devel@lists.sourceforge.net; Thu, 11 Feb 2010 03:51:24 +0000 Received-SPF: pass (sfi-mx-2.v28.ch3.sourceforge.com: domain of gmail.com designates 209.85.210.177 as permitted sender) client-ip=209.85.210.177; envelope-from=mattst88@gmail.com; helo=mail-yx0-f177.google.com; Received: from mail-yx0-f177.google.com ([209.85.210.177]) by sfi-mx-2.v28.ch3.sourceforge.com with esmtp (Exim 4.69) id 1NfQ5L-0005Pa-Q7 for dri-devel@lists.sourceforge.net; Thu, 11 Feb 2010 03:51:24 +0000 Received: by yxe7 with SMTP id 7so712398yxe.10 for ; Wed, 10 Feb 2010 19:51:18 -0800 (PST) Received: by 10.101.105.30 with SMTP id h30mr1618775anm.225.1265860278159; Wed, 10 Feb 2010 19:51:18 -0800 (PST) Received: from mattst88@gmail.com ([204.84.232.251]) by mx.google.com with ESMTPS id 21sm759484ywh.1.2010.02.10.19.51.16 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 10 Feb 2010 19:51:17 -0800 (PST) Received: by mattst88@gmail.com (sSMTP sendmail emulation); Wed, 10 Feb 2010 22:57:02 -0500 From: Matt Turner To: dri-devel@lists.sourceforge.net Subject: [PATCH] drm/radeon/kms/atom: use get_unaligned() for ctx->ps Date: Wed, 10 Feb 2010 22:56:41 -0500 Message-Id: <1265860601-2915-1-git-send-email-mattst88@gmail.com> X-Mailer: git-send-email 1.6.5.3 X-Spam-Score: -0.4 (/) X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. -1.5 SPF_CHECK_PASS SPF reports sender host as permitted sender for sender-domain 1.1 RCVD_IN_SORBS_WEB RBL: SORBS: sender is a abuseable web server [204.84.232.251 listed in dnsbl.sorbs.net] -0.0 SPF_PASS SPF: sender matches SPF record -0.0 DKIM_VERIFIED Domain Keys Identified Mail: signature passes verification 0.0 DKIM_SIGNED Domain Keys Identified Mail: message has a signature X-Headers-End: 1NfQ5L-0005Pa-Q7 Cc: Alex Deucher , Dave Airlie , Jerome Glisse X-BeenThere: dri-devel@lists.sourceforge.net X-Mailman-Version: 2.1.9 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.sourceforge.net X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Thu, 11 Feb 2010 03:53:30 +0000 (UTC) diff --git a/drivers/gpu/drm/radeon/atom.c b/drivers/gpu/drm/radeon/atom.c index bd0c843..c1d3c24 100644 --- a/drivers/gpu/drm/radeon/atom.c +++ b/drivers/gpu/drm/radeon/atom.c @@ -24,6 +24,7 @@ #include #include +#include #define ATOM_DEBUG @@ -212,7 +213,9 @@ static uint32_t atom_get_src_int(atom_exec_context *ctx, uint8_t attr, case ATOM_ARG_PS: idx = U8(*ptr); (*ptr)++; - val = le32_to_cpu(ctx->ps[idx]); + /* get_unaligned avoids unaligned accesses from atombios tables + * 21, 24, 42. */ + val = le32_to_cpu(get_unaligned((u32 *)&ctx->ps[idx])); if (print) DEBUG("PS[0x%02X,0x%04X]", idx, val); break;