From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C467FC6FA82 for ; Fri, 23 Sep 2022 07:18:57 +0000 (UTC) Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4MYk683qmdz3dtW for ; Fri, 23 Sep 2022 17:18:56 +1000 (AEST) Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gmail.com (client-ip=209.85.219.50; helo=mail-qv1-f50.google.com; envelope-from=geert.uytterhoeven@gmail.com; receiver=) Received: from mail-qv1-f50.google.com (mail-qv1-f50.google.com [209.85.219.50]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4MYk5j5Vmyz30R7 for ; Fri, 23 Sep 2022 17:18:33 +1000 (AEST) Received: by mail-qv1-f50.google.com with SMTP id z9so8474719qvn.9 for ; Fri, 23 Sep 2022 00:18:33 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date; bh=6vg6B8D/hQyHxlC2HaS8TXm7SR0b9itjbd+F1YgR9rg=; b=3vE8kehNUtKltbOFDJUqKDwLTDFYHc7d9pLzSnw1JDSOm/KQoS2x5+Y7FoE3S1asFm 1FUuuDtqDmhBfmyLiCUIkFp2ytsclBWsnUtySsfr2woCB+K5CMuJqqKeWwpLunc0Zoz5 PQrA2ikvkSKG1IQXV/aSpzaIS0TSlfD9n7dDzx63aemIMYfbZFc2nxF6uaRqjuU/oC0f ehyNZj8tLlPG+Qx+4pLFjaMkvt75beiKILFXdBMW03uXolAr1M2j+N9An0n3xMbJRry5 4hevEcArH8YmEeijVtK20QdLbq1tf3PCg30ryq8wyk9eY97W5cLcV7r+JM1gKALiV0fA DHhg== X-Gm-Message-State: ACrzQf1/uyVdDCuWgfijf8X27/zH8HE2XanLmo8RykIuzFTksCvV6GhK 6bad87OfIxYwX2xk5ZTZe1RJzLZSVh/6JQ== X-Google-Smtp-Source: AMsMyM45CmJa3EBYh3zQm8jPYHY7n/CuGoFISUIBn37Q9iDuWZ3clGjcTD5Mo+PwBzncYUhmzc1ARw== X-Received: by 2002:a0c:da14:0:b0:4aa:aad9:e450 with SMTP id x20-20020a0cda14000000b004aaaad9e450mr5870952qvj.130.1663917510971; Fri, 23 Sep 2022 00:18:30 -0700 (PDT) Received: from mail-yw1-f180.google.com (mail-yw1-f180.google.com. [209.85.128.180]) by smtp.gmail.com with ESMTPSA id cp4-20020a05622a420400b0035cdd7a42d0sm4739050qtb.22.2022.09.23.00.18.28 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 23 Sep 2022 00:18:29 -0700 (PDT) Received: by mail-yw1-f180.google.com with SMTP id 00721157ae682-345528ceb87so122858257b3.11 for ; Fri, 23 Sep 2022 00:18:28 -0700 (PDT) X-Received: by 2002:a81:78f:0:b0:34d:74c0:1110 with SMTP id 137-20020a81078f000000b0034d74c01110mr7049955ywh.383.1663917508700; Fri, 23 Sep 2022 00:18:28 -0700 (PDT) MIME-Version: 1.0 References: <20220922113306.11251-1-tzimmermann@suse.de> <20220922113306.11251-5-tzimmermann@suse.de> In-Reply-To: <20220922113306.11251-5-tzimmermann@suse.de> From: Geert Uytterhoeven Date: Fri, 23 Sep 2022 09:18:17 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v3 4/4] drm/ofdrm: Support color management To: Thomas Zimmermann Content-Type: text/plain; charset="UTF-8" X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-fbdev@vger.kernel.org, airlied@linux.ie, deller@gmx.de, linuxppc-dev@lists.ozlabs.org, mark.cave-ayland@ilande.co.uk, javierm@redhat.com, dri-devel@lists.freedesktop.org, paulus@samba.org, maxime@cerno.tech, daniel@ffwll.ch, msuchanek@suse.de, sam@ravnborg.org Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" Hi Thomas, On Thu, Sep 22, 2022 at 1:33 PM Thomas Zimmermann wrote: > Support the CRTC's color-management property and implement each model's > palette support. > > The OF hardware has different methods of setting the palette. The > respective code has been taken from fbdev's offb and refactored into > per-model device functions. The device functions integrate this > functionality into the overall modesetting. > > As palette handling is a CRTC property that depends on the primary > plane's color format, the plane's atomic_check helper now updates the > format field in ofdrm's custom CRTC state. The CRTC's atomic_flush > helper updates the palette for the format as needed. > > v3: > * lookup CRTC state with drm_atomic_get_new_crtc_state() > * access HW palette with writeb(), writel(), and readl() (Ben) > * declare register values as u32 > > Signed-off-by: Thomas Zimmermann > Reviewed-by: Javier Martinez Canillas Thanks for your patch! > --- a/drivers/gpu/drm/tiny/ofdrm.c > +++ b/drivers/gpu/drm/tiny/ofdrm.c > +static void __iomem *ofdrm_qemu_cmap_ioremap(struct ofdrm_device *odev, > + struct device_node *of_node, > + u64 fb_base) > +{ > +#ifdef __BIG_ENDIAN > + static const __be32 io_of_addr[3] = { 0x01000000, 0x0, 0x0 }; > +#else > + static const __be32 io_of_addr[3] = { 0x00000001, 0x0, 0x0 }; > +#endif You can easily get rid of the #ifdef: static const __be32 io_of_addr[3] = { cpu_to_be32(0x01000000), 0x0, 0x0 }; And probably sparse ("make C=2") will complain about the plain zeros, so "cpu_to_be32(0x0)" as well. Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds