[PATCH v5 04/10] drm: rcar-du: Add rcar_du_lib_fb_create()
Geert Uytterhoeven
geert at linux-m68k.org
Thu Aug 18 09:29:32 UTC 2022
Hi Biju,
On Wed, Jul 27, 2022 at 6:08 PM Biju Das <biju.das.jz at bp.renesas.com> wrote:
> Move the common code from rcar_du_fb_create->rcar_du_lib_fb_create,
> so that rzg2l_du_fb_create() can reuse the common code.
>
> Signed-off-by: Biju Das <biju.das.jz at bp.renesas.com>
> ---
> v5:
> * New patch
Thanks for your patch!
> --- a/drivers/gpu/drm/rcar-du/rcar_du_kms_lib.c
> +++ b/drivers/gpu/drm/rcar-du/rcar_du_kms_lib.c
> @@ -392,3 +392,72 @@ int rcar_du_dumb_create(struct drm_file *file, struct drm_device *dev,
>
> return drm_gem_cma_dumb_create_internal(file, dev, args);
> }
> +
> +struct drm_framebuffer *
> +rcar_du_lib_fb_create(struct drm_device *dev, struct drm_file *file_priv,
> + const struct drm_mode_fb_cmd2 *mode_cmd)
> +{
> + struct rcar_du_device *rcdu = to_rcar_du_device(dev);
> + const struct rcar_du_format_info *format;
> + unsigned int chroma_pitch;
> + unsigned int max_pitch;
> + unsigned int align;
> + unsigned int i;
> +
> + format = rcar_du_format_info(mode_cmd->pixel_format);
> + if (format == NULL) {
> + dev_dbg(dev->dev, "unsupported pixel format %08x\n",
I know you're just moving code, but nowadays we do have "%p4cc",
which takes a pointer to the fourcc value.
> + mode_cmd->pixel_format);
> + return ERR_PTR(-EINVAL);
> + }
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert at 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
More information about the dri-devel
mailing list