From patchwork Tue Sep 13 13:37:19 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Malaterre X-Patchwork-Id: 9329131 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id B4E956077F for ; Tue, 13 Sep 2016 13:37:47 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A5D7C29453 for ; Tue, 13 Sep 2016 13:37:47 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 954FE2945F; Tue, 13 Sep 2016 13:37:47 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4A66329453 for ; Tue, 13 Sep 2016 13:37:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756233AbcIMNhn (ORCPT ); Tue, 13 Sep 2016 09:37:43 -0400 Received: from mail-wm0-f65.google.com ([74.125.82.65]:34335 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750940AbcIMNhl (ORCPT ); Tue, 13 Sep 2016 09:37:41 -0400 Received: by mail-wm0-f65.google.com with SMTP id g141so7373027wmd.1 for ; Tue, 13 Sep 2016 06:37:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=wt6FwIB4sTUCfQvkPhtv/USDRX25FIC8vHIMaXhiFgY=; b=gCZ+GnJehwROJ+LxrxUQfB/f6/2D5zru1qR7eEeecYwbbo1VBcaYK0+lqsXiT5HKKN q+h/7duZW7qaczL6JVv/fPGT7wlBA7/MG87jq0zNEdDElxv/SkoGXwc4Wtx1YK1f7jHm vmLdj2OiOfr2RsglrKDzNn7iySz+VNJLPG/CJrpBfeItLe6Qfo0KW8sXaqphpnPBcYNP U59zkjJNZoD82cWKSA/bhVkJqTvBp8FiBNZVRScpNPxqS9JUcDuXQ+PXws8igYm75S5g mjJgHtYYKXlzshn+42ghYXgEAnqDlvu9Pd17qVnWwADGSWvJUp4V+xs4k5nhYDkkJa5l h6Hg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=wt6FwIB4sTUCfQvkPhtv/USDRX25FIC8vHIMaXhiFgY=; b=RWQb3Kk+JEo8ONg8BRSLkl8Qtks3z35RiE7AFqHLFUvhBM7174CXgUVgVk9PEXRWd9 D0Q7ba3xFgGuNPFsI35OlFqh66nMhitxZrs0sE8rjR6XuGudBNzh+BCgXY3DplmiP+4K VU1m0mOZoE6c0FWW6ZpJMG7RDMTwINcVKc2TzQop7cGbkgW2JPO8tGKw6irKLokB53kh hFbCcBwgv5IAHbmBSGx5uJOqzlV5hupBSlkbew4CTAC/jwsavDjbrW24EbZBdkuwK248 EQmhfvY/F9dhvbKF0l97sZGnsuMXPxxCjtKR0mWRdIME1m3IPkXbjnqdnk965A7xUmH5 DQ1g== X-Gm-Message-State: AE9vXwMsX0J8VdC+qk4fmUx93s6STkKy4X0boG1qx9HJXaUQ8vXB8yDoLmrZf9F29HdBDO32ms6Ug9MFZrkYvQ== X-Received: by 10.28.46.204 with SMTP id u195mr4970511wmu.57.1473773859714; Tue, 13 Sep 2016 06:37:39 -0700 (PDT) MIME-Version: 1.0 Received: by 10.194.178.135 with HTTP; Tue, 13 Sep 2016 06:37:19 -0700 (PDT) In-Reply-To: References: From: Mathieu Malaterre Date: Tue, 13 Sep 2016 15:37:19 +0200 X-Google-Sender-Auth: NJUPI46hbsNagKQnAFoLYbkEl48 Message-ID: Subject: Re: [powerpc] offb: red / blue color inversion To: Geert Uytterhoeven Cc: Linux Fbdev development list Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Geert, On Fri, Jun 17, 2016 at 9:11 AM, Geert Uytterhoeven wrote: > Hi Mathieu, > > On Thu, Jun 9, 2016 at 2:25 PM, Mathieu Malaterre wrote: >> I am trying to fix an issue with color inversion in the current offb.c >> implementation. I am using a Mac Mini G4 (PPC) with: >> >> [ 0.844144] fb0: Open Firmware frame buffer device on >> /pci@f0000000/ATY,RockHopper2Parent@10/ATY,RockHopper2_A@0 >> >> reported as [*]. I have tried looking at the upstream code source, and >> it appears that my configuration falls into the 'cmap_simple'. But >> other than that I failed to understand what could be wrong (palette >> would be setup backward). > > The palette code for cmap_simple writes the color components in the > order RGB, while your card seems to need BGR. > > Hence either the cmap_addr/cmap_data registers are wrong, or > you have to add a cmap_inverted type that writes in the BGR order. > > For both cases, you have to add a check to offb_init_palette_hacks() in > drivers/video/fbdev/offb.c. Well I tried a (very naive) patch as follow: However it does not seems to fix the Red / Blue color inversion I am seeing. Could you please be a little more verbose in the way I need to reorder color component from RGB to BGR ? Thanks again -M --- To unsubscribe from this list: send the line "unsubscribe linux-fbdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html --- a/drivers/video/fbdev/offb.c 2016-09-13 15:33:41.043843352 +0200 +++ b/drivers/video/fbdev/offb.c 2016-08-20 18:11:18.000000000 +0200 @@ -133,9 +133,9 @@ switch (par->cmap_type) { case cmap_simple: writeb(regno, par->cmap_adr); - writeb(blue, par->cmap_data); - writeb(green, par->cmap_data); writeb(red, par->cmap_data); + writeb(green, par->cmap_data); + writeb(blue, par->cmap_data); break; case cmap_M3A: /* Clear PALETTE_ACCESS_CNTL in DAC_CNTL */