[PATCHv6 6/6] drm/rockchip: Add support for afbc

Emil Velikov emil.l.velikov at gmail.com
Tue Mar 3 17:17:50 UTC 2020


Hi Andrzej,

On Tue, 3 Mar 2020 at 12:02, Andrzej Pietrasiewicz
<andrzej.p at collabora.com> wrote:

> +static struct drm_framebuffer *
> +rockchip_fb_create(struct drm_device *dev, struct drm_file *file,
> +                  const struct drm_mode_fb_cmd2 *mode_cmd)
> +{
> +       struct drm_afbc_framebuffer *afbc_fb;
> +       struct drm_framebuffer *ret;
> +
> +       afbc_fb = kzalloc(sizeof(*afbc_fb), GFP_KERNEL);
> +       if (!afbc_fb)
> +               return ERR_PTR(-ENOMEM);
> +
> +       ret = drm_gem_fb_init_with_funcs(dev, &afbc_fb->base, file, mode_cmd, &rockchip_drm_fb_funcs);
> +       if (IS_ERR_OR_NULL(ret)) {
Like with 1/6 this should be IS_ERR().


> +static bool rockchip_mod_supported(struct drm_plane *plane,
> +                                  u32 format, u64 modifier)
> +{
> +       if (WARN_ON(modifier == DRM_FORMAT_MOD_INVALID))

AFAICT this should never trigger. If it does nearly every DRM driver
will be broken.
Seems like you've copied this from malidp and another offender being meson.

Would suggest fixing the latter two (optional), but at the very least
let's avoid adding new instances.

-Emil


More information about the dri-devel mailing list