[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20181204175421.GT988@e110455-lin.cambridge.arm.com>
Date: Tue, 4 Dec 2018 17:54:21 +0000
From: Liviu Dudau <Liviu.Dudau@....com>
To: Ayan Halder <Ayan.Halder@....com>
Cc: Brian Starkey <Brian.Starkey@....com>,
"malidp@...s.arm.com" <malidp@...s.arm.com>,
"airlied@...ux.ie" <airlied@...ux.ie>,
"dri-devel@...ts.freedesktop.org" <dri-devel@...ts.freedesktop.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"maxime.ripard@...tlin.com" <maxime.ripard@...tlin.com>,
"sean@...rly.run" <sean@...rly.run>,
"maarten.lankhorst@...ux.intel.com"
<maarten.lankhorst@...ux.intel.com>,
"corbet@....net" <corbet@....net>,
"mchehab+samsung@...nel.org" <mchehab+samsung@...nel.org>,
"gregkh@...uxfoundation.org" <gregkh@...uxfoundation.org>,
"davem@...emloft.net" <davem@...emloft.net>,
"akpm@...ux-foundation.org" <akpm@...ux-foundation.org>,
"nicolas.ferre@...rochip.com" <nicolas.ferre@...rochip.com>,
"arnd@...db.de" <arnd@...db.de>,
"linux-doc@...r.kernel.org" <linux-doc@...r.kernel.org>,
nd <nd@....com>
Subject: Re: [RFC v3 AFBC 12/12] drm/arm/malidp: Added support for AFBC
modifiers for all layers except DE_SMART
On Mon, Dec 03, 2018 at 11:32:06AM +0000, Ayan Halder wrote:
> The list of modifiers to be supported for each plane has been dynamically generated
> from 'malidp_format_modifiers[]' and 'malidp_hw_regmap->features'.
>
> Changes from v1:-
> 1. Replaced DRM_ERROR() with DRM_DEBUG_KMS() in malidp_format_mod_supported()
> to report unsupported modifiers.
>
> Changes from v2:-
> 1. Removed malidp_format_mod_supported() from the current patch. This has been added
> in "PATCH 7/12"
> 2. Dynamically generate the list of modifiers (to be supported for each plane) from
> 'malidp_format_modifiers' and features.
>
> Signed-off-by: Ayan Kumar halder <ayan.halder@....com>
Reviewed-by: Liviu Dudau <liviu.dudau@....com>
Best regards,
Liviu
> ---
> drivers/gpu/drm/arm/malidp_drv.c | 1 +
> drivers/gpu/drm/arm/malidp_planes.c | 28 ++++++++++++++++++++++++++--
> 2 files changed, 27 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/arm/malidp_drv.c b/drivers/gpu/drm/arm/malidp_drv.c
> index b2b97db..be45703 100644
> --- a/drivers/gpu/drm/arm/malidp_drv.c
> +++ b/drivers/gpu/drm/arm/malidp_drv.c
> @@ -388,6 +388,7 @@ static int malidp_init(struct drm_device *drm)
> drm->mode_config.max_height = hwdev->max_line_size;
> drm->mode_config.funcs = &malidp_mode_config_funcs;
> drm->mode_config.helper_private = &malidp_mode_config_helpers;
> + drm->mode_config.allow_fb_modifiers = true;
>
> ret = malidp_crtc_init(drm);
> if (ret)
> diff --git a/drivers/gpu/drm/arm/malidp_planes.c b/drivers/gpu/drm/arm/malidp_planes.c
> index eec0442..01037d0 100644
> --- a/drivers/gpu/drm/arm/malidp_planes.c
> +++ b/drivers/gpu/drm/arm/malidp_planes.c
> @@ -934,6 +934,25 @@ int malidp_de_planes_init(struct drm_device *drm)
> BIT(DRM_MODE_BLEND_COVERAGE);
> u32 *formats;
> int ret, i, j, n;
> + u64 supported_modifiers[MODIFIERS_COUNT_MAX];
> + const u64 *modifiers;
> +
> + modifiers = malidp_format_modifiers;
> +
> + if (!(map->features & MALIDP_DEVICE_AFBC_SUPPORT_SPLIT)) {
> + /*
> + * Since our hardware does not support SPLIT, so build the list of
> + * supported modifiers excluding SPLIT ones.
> + */
> + while (*modifiers != DRM_FORMAT_MOD_INVALID) {
> + if (!(*modifiers & AFBC_SPLIT))
> + supported_modifiers[j++] = *modifiers;
> +
> + modifiers++;
> + }
> + supported_modifiers[j++] = DRM_FORMAT_MOD_INVALID;
> + modifiers = supported_modifiers;
> + }
>
> formats = kcalloc(map->n_pixel_formats, sizeof(*formats), GFP_KERNEL);
> if (!formats) {
> @@ -958,9 +977,14 @@ int malidp_de_planes_init(struct drm_device *drm)
>
> plane_type = (i == 0) ? DRM_PLANE_TYPE_PRIMARY :
> DRM_PLANE_TYPE_OVERLAY;
> +
> + /*
> + * All the layers except smart layer supports AFBC modifiers.
> + */
> ret = drm_universal_plane_init(drm, &plane->base, crtcs,
> - &malidp_de_plane_funcs, formats,
> - n, NULL, plane_type, NULL);
> + &malidp_de_plane_funcs, formats, n,
> + (id == DE_SMART) ? NULL : modifiers, plane_type, NULL);
> +
> if (ret < 0)
> goto cleanup;
>
> --
> 2.7.4
>
--
====================
| I would like to |
| fix the world, |
| but they're not |
| giving me the |
\ source code! /
---------------
¯\_(ツ)_/¯
Powered by blists - more mailing lists