From patchwork Wed Apr 24 18:40:24 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Deucher X-Patchwork-Id: 2485851 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by patchwork2.kernel.org (Postfix) with ESMTP id AC3DCDF25A for ; Wed, 24 Apr 2013 18:43:28 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 8D905E5FD6 for ; Wed, 24 Apr 2013 11:43:28 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-qc0-f182.google.com (mail-qc0-f182.google.com [209.85.216.182]) by gabe.freedesktop.org (Postfix) with ESMTP id 89986E62B2 for ; Wed, 24 Apr 2013 11:40:29 -0700 (PDT) Received: by mail-qc0-f182.google.com with SMTP id k19so1106965qcs.41 for ; Wed, 24 Apr 2013 11:40:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer; bh=4SH1/cxEP9pcXwWaP5J674jsszLc2/+oUUIxMkwvrKM=; b=lH0WMbkNAbCMrslXTYqHLBn/WXFBdQI/SZ7WJmQG/Oe+0Y5iYlUiSlq1W2tmCyWtRw JfnWETH7VoP3G0IURrc75lGz/Iudg+QLIIjrV+pQbMwui3KmWYP7TiNnocaqEcFucpG/ pzHGjFjV8gvY5yKsliQCrUnDxsUpTPpq+H0X9qQLsP7ZxGbeGUVhM78tSTtygopHassH 8cctyu4NXcEIjdDG9S+adrml77OsvTmK07fSsUqO7/In4UVdtuHbHHEldHkplXF4mZ7x jmlY9pbxIsEgWk+6ZVuRnwpd6GqLpPmv4nLbLy7KKBAiqZKAgTGog4oHIQEhKBCeI5WR yW4A== X-Received: by 10.224.179.202 with SMTP id br10mr31784133qab.83.1366828829302; Wed, 24 Apr 2013 11:40:29 -0700 (PDT) Received: from localhost.localdomain (static-74-96-105-49.washdc.fios.verizon.net. [74.96.105.49]) by mx.google.com with ESMTPSA id n3sm6183523qat.6.2013.04.24.11.40.28 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Wed, 24 Apr 2013 11:40:28 -0700 (PDT) From: alexdeucher@gmail.com To: dri-devel@lists.freedesktop.org Subject: [PATCH] drm/radeon: fix endian bugs in atom_allocate_fb_scratch() Date: Wed, 24 Apr 2013 14:40:24 -0400 Message-Id: <1366828824-9136-1-git-send-email-alexdeucher@gmail.com> X-Mailer: git-send-email 1.7.7.5 Cc: Alex Deucher , stable@vger.kernel.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org Errors-To: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org From: Alex Deucher Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org --- drivers/gpu/drm/radeon/atom.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/radeon/atom.c b/drivers/gpu/drm/radeon/atom.c index 46a9c37..fb441a7 100644 --- a/drivers/gpu/drm/radeon/atom.c +++ b/drivers/gpu/drm/radeon/atom.c @@ -1394,10 +1394,10 @@ int atom_allocate_fb_scratch(struct atom_context *ctx) firmware_usage = (struct _ATOM_VRAM_USAGE_BY_FIRMWARE *)(ctx->bios + data_offset); DRM_DEBUG("atom firmware requested %08x %dkb\n", - firmware_usage->asFirmwareVramReserveInfo[0].ulStartAddrUsedByFirmware, - firmware_usage->asFirmwareVramReserveInfo[0].usFirmwareUseInKb); + le32_to_cpu(firmware_usage->asFirmwareVramReserveInfo[0].ulStartAddrUsedByFirmware), + le16_to_cpu(firmware_usage->asFirmwareVramReserveInfo[0].usFirmwareUseInKb)); - usage_bytes = firmware_usage->asFirmwareVramReserveInfo[0].usFirmwareUseInKb * 1024; + usage_bytes = le16_to_cpu(firmware_usage->asFirmwareVramReserveInfo[0].usFirmwareUseInKb) * 1024; } ctx->scratch_size_bytes = 0; if (usage_bytes == 0)