linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Geert Uytterhoeven <geert@linux-m68k.org>
To: Thomas Zimmermann <tzimmermann@suse.de>
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
Subject: Re: [PATCH v3 4/4] drm/ofdrm: Support color management
Date: Fri, 23 Sep 2022 09:18:17 +0200	[thread overview]
Message-ID: <CAMuHMdXM2JmnVAgCjSAAf2swX=2T7h5wtFcfWZ5uJEbs5GCvqg@mail.gmail.com> (raw)
In-Reply-To: <20220922113306.11251-5-tzimmermann@suse.de>

Hi Thomas,

On Thu, Sep 22, 2022 at 1:33 PM Thomas Zimmermann <tzimmermann@suse.de> 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 <tzimmermann@suse.de>
> Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>

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

      reply	other threads:[~2022-09-23  7:18 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-22 11:33 [PATCH v3 0/4] drm: Add driver for PowerPC OF displays Thomas Zimmermann
2022-09-22 11:33 ` [PATCH v3 1/4] drm/ofdrm: Add ofdrm for Open Firmware framebuffers Thomas Zimmermann
2022-09-23  7:14   ` Geert Uytterhoeven
2022-09-23  7:41     ` Thomas Zimmermann
2022-09-27 15:33     ` Thomas Zimmermann
2022-09-22 11:33 ` [PATCH v3 2/4] drm/ofdrm: Add CRTC state Thomas Zimmermann
2022-09-22 11:33 ` [PATCH v3 3/4] drm/ofdrm: Add per-model device function Thomas Zimmermann
2022-09-22 11:33 ` [PATCH v3 4/4] drm/ofdrm: Support color management Thomas Zimmermann
2022-09-23  7:18   ` Geert Uytterhoeven [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAMuHMdXM2JmnVAgCjSAAf2swX=2T7h5wtFcfWZ5uJEbs5GCvqg@mail.gmail.com' \
    --to=geert@linux-m68k.org \
    --cc=airlied@linux.ie \
    --cc=daniel@ffwll.ch \
    --cc=deller@gmx.de \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=javierm@redhat.com \
    --cc=linux-fbdev@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=mark.cave-ayland@ilande.co.uk \
    --cc=maxime@cerno.tech \
    --cc=msuchanek@suse.de \
    --cc=paulus@samba.org \
    --cc=sam@ravnborg.org \
    --cc=tzimmermann@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).