From patchwork Mon Apr 22 14:03:13 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Deucher X-Patchwork-Id: 2471971 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 26E42DF23A for ; Mon, 22 Apr 2013 14:03:34 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 180A7E682E for ; Mon, 22 Apr 2013 07:03:34 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-qa0-f52.google.com (mail-qa0-f52.google.com [209.85.216.52]) by gabe.freedesktop.org (Postfix) with ESMTP id 810D6E5C7B for ; Mon, 22 Apr 2013 07:03:20 -0700 (PDT) Received: by mail-qa0-f52.google.com with SMTP id hg5so340260qab.4 for ; Mon, 22 Apr 2013 07:03:20 -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:in-reply-to :references; bh=36syQ549FbRM53Ehf3ejmnv0/SwMc3OBTQgkEL1Jfic=; b=p2Ja58FYbOFoZ1WBsR0JzQNi5cawE69zfZKi8rf4iJW/HYIdDbr1aaE4kCnMn/fk0Z Dyrbr7rcCp5q5Lj2Ssf6knQ9tP+GXCJ9cWTcO5mkMhxwSZCHAJUbZqx2AQ3I2nLwrBOG UEsaqbopmq/LlbvYqPMdiKATVjsqF6z6mRT9S1A3kZ3Pv9TRX5uNRSXovNxC2bntgxpe QEG6TwXZu6aYpZz24DyxajnOPjznCkYStX7XfAn6xzuV+yZbRx6mzJkTNq7krDIZ4qqF XtWpx6GwuLNyeH4NqM7KTE368FxNNtv7mEEtscGZ3x9Hmkh3lMHkEQE9w6s4YIwsxlis GpoA== X-Received: by 10.229.179.197 with SMTP id br5mr5311317qcb.107.1366639399898; Mon, 22 Apr 2013 07:03:19 -0700 (PDT) Received: from localhost.localdomain (static-74-96-105-49.washdc.fios.verizon.net. [74.96.105.49]) by mx.google.com with ESMTPS id z2sm28313867qad.4.2013.04.22.07.03.18 (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 22 Apr 2013 07:03:19 -0700 (PDT) From: alexdeucher@gmail.com To: dri-devel@lists.freedesktop.org, dan.carpenter@oracle.com Subject: [PATCH] drm/radeon: fix endian bugs in radeon_atom_get_clock_dividers() Date: Mon, 22 Apr 2013 10:03:13 -0400 Message-Id: <1366639393-10190-1-git-send-email-alexdeucher@gmail.com> X-Mailer: git-send-email 1.7.7.5 In-Reply-To: <20130418184709.GA11596@elgon.mountain> References: <20130418184709.GA11596@elgon.mountain> Cc: Alex Deucher 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 Reported-by: Dan Carpenter Signed-off-by: Alex Deucher --- drivers/gpu/drm/radeon/atombios.h | 2 ++ drivers/gpu/drm/radeon/radeon_atombios.c | 6 ++---- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/radeon/atombios.h b/drivers/gpu/drm/radeon/atombios.h index 4b04ba3..de678dd 100644 --- a/drivers/gpu/drm/radeon/atombios.h +++ b/drivers/gpu/drm/radeon/atombios.h @@ -459,6 +459,7 @@ typedef struct _COMPUTE_MEMORY_ENGINE_PLL_PARAMETERS_V3 { ATOM_COMPUTE_CLOCK_FREQ ulClock; //Input Parameter ATOM_S_MPLL_FB_DIVIDER ulFbDiv; //Output Parameter + ULONG ulClockFbDiv; }; UCHAR ucRefDiv; //Output Parameter UCHAR ucPostDiv; //Output Parameter @@ -491,6 +492,7 @@ typedef struct _COMPUTE_MEMORY_ENGINE_PLL_PARAMETERS_V5 { ATOM_COMPUTE_CLOCK_FREQ ulClock; //Input Parameter ATOM_S_MPLL_FB_DIVIDER ulFbDiv; //Output Parameter + ULONG ulClockFbDiv; }; UCHAR ucRefDiv; //Output Parameter UCHAR ucPostDiv; //Output Parameter diff --git a/drivers/gpu/drm/radeon/radeon_atombios.c b/drivers/gpu/drm/radeon/radeon_atombios.c index 8c1779c..2fc444e 100644 --- a/drivers/gpu/drm/radeon/radeon_atombios.c +++ b/drivers/gpu/drm/radeon/radeon_atombios.c @@ -2710,8 +2710,7 @@ int radeon_atom_get_clock_dividers(struct radeon_device *rdev, dividers->enable_post_div = (dividers->fb_div & 1) ? true : false; } else { if (clock_type == COMPUTE_ENGINE_PLL_PARAM) { - args.v3.ulClock.ulComputeClockFlag = clock_type; - args.v3.ulClock.ulClockFreq = cpu_to_le32(clock); /* 10 khz */ + args.v3.ulClockFbDiv = cpu_to_le32((clock_type << 24) | clock); atom_execute_table(rdev->mode_info.atom_context, index, (uint32_t *)&args); @@ -2726,8 +2725,7 @@ int radeon_atom_get_clock_dividers(struct radeon_device *rdev, dividers->vco_mode = (args.v3.ucCntlFlag & ATOM_PLL_CNTL_FLAG_MPLL_VCO_MODE) ? 1 : 0; } else { - args.v5.ulClock.ulComputeClockFlag = clock_type; - args.v5.ulClock.ulClockFreq = cpu_to_le32(clock); /* 10 khz */ + args.v3.ulClockFbDiv = cpu_to_le32((clock_type << 24) | clock); if (strobe_mode) args.v5.ucInputFlag = ATOM_PLL_INPUT_FLAG_PLL_STROBE_MODE_EN;