Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp8539468imu; Tue, 4 Dec 2018 09:55:31 -0800 (PST) X-Google-Smtp-Source: AFSGD/WqGkT/Ca5ZL/Pdz8LU5mbMjaBVLmDtc81o1LU+enyU/eooh05ClkhPpBKCnYtfW0+DhKrs X-Received: by 2002:a63:ac1a:: with SMTP id v26mr17826607pge.293.1543946131501; Tue, 04 Dec 2018 09:55:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543946131; cv=none; d=google.com; s=arc-20160816; b=BUybq+YDnhnswTwx12zkRFmqJDtDVE6NIYGeiHVWm/+VojJRLV5BpJZndJSBDjMoX/ IrXRLjb7tRo2DNMPH6JjbGJ8vZl5IuJm22yA9r9ndfIilaaPSMOGX/Kt1k1h9XM+VgPz chWCRK/kDkSL4r120X+dxwbNWyuKS/etXmNMhvpU6W6xQOhoLBQOtvd+2UlZZeZTr69c osVRjAnh8Mxg7jbJqcvHZtTHRyWklm3zsK19gYH0kE14YzY3F2DkEgfwyip7HRwpLOeM Tcf+j5v9BEv/Sav7WO/YIPboWoF1YUW6GVzKAGxDgyQ5+K9BzsgZmqxMkqKKA94UjSNi ADLg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=GPxBcQ/uLPLm9YRSqryKHkOa6CikG5VQS2A2UhDtw9Y=; b=rXMS5H52UK8we3A8DJlPYqy0wf9CWsQtQpTCu/+x/8p2yv23rKMNc0Brl1zDSBBjcU EpNxsnp7ni5IeFKVAxVHTDLbYdbny9p+mWiM/4YKb9pm3bHzoL5cQmmjlk15lgfSCqLB JmhiF7YelxDsuRz1786lIKrOAgfO9bYSoGJP4DpPGVQOi5aq3/fATL4yImSLJHRAT1fr lHQt/HCPjmuJT5k2AK3aervd/oqrUrY9AGo/Bd8a3ccOCuh1sCAWU8C76PF8uLrqcPKx u4RUR55iFGV7m02qBTuDVvI2ELpErO5UAod+aCiT6KsbTHfKcpI+KUTtosZDxkKMI5fX NFPw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k5si7715872plt.111.2018.12.04.09.55.16; Tue, 04 Dec 2018 09:55:31 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726353AbeLDRyZ (ORCPT + 99 others); Tue, 4 Dec 2018 12:54:25 -0500 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:38242 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726038AbeLDRyY (ORCPT ); Tue, 4 Dec 2018 12:54:24 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id DD952A78; Tue, 4 Dec 2018 09:54:23 -0800 (PST) Received: from e110455-lin.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.72.51.249]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 7F4A13F59C; Tue, 4 Dec 2018 09:54:23 -0800 (PST) Received: by e110455-lin.cambridge.arm.com (Postfix, from userid 1000) id CC65A6801C3; Tue, 4 Dec 2018 17:54:21 +0000 (GMT) Date: Tue, 4 Dec 2018 17:54:21 +0000 From: Liviu Dudau To: Ayan Halder Cc: Brian Starkey , "malidp@foss.arm.com" , "airlied@linux.ie" , "dri-devel@lists.freedesktop.org" , "linux-kernel@vger.kernel.org" , "maxime.ripard@bootlin.com" , "sean@poorly.run" , "maarten.lankhorst@linux.intel.com" , "corbet@lwn.net" , "mchehab+samsung@kernel.org" , "gregkh@linuxfoundation.org" , "davem@davemloft.net" , "akpm@linux-foundation.org" , "nicolas.ferre@microchip.com" , "arnd@arndb.de" , "linux-doc@vger.kernel.org" , nd Subject: Re: [RFC v3 AFBC 12/12] drm/arm/malidp: Added support for AFBC modifiers for all layers except DE_SMART Message-ID: <20181204175421.GT988@e110455-lin.cambridge.arm.com> References: <1543836703-8491-1-git-send-email-ayan.halder@arm.com> <1543836703-8491-13-git-send-email-ayan.halder@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1543836703-8491-13-git-send-email-ayan.halder@arm.com> User-Agent: Mutt/1.11.1 (2018-12-01) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 Reviewed-by: Liviu Dudau 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! / --------------- ¯\_(ツ)_/¯