Received: by 10.223.176.5 with SMTP id f5csp1690038wra; Thu, 8 Feb 2018 01:41:56 -0800 (PST) X-Google-Smtp-Source: AH8x225hSj1rKSuTCZSIGXGFIw9xDdYvlzkRIsqSKw5Hmo0m3qkiHAyen/X1RsSNjtHPAkdbUh8I X-Received: by 2002:a17:902:aa95:: with SMTP id d21-v6mr109163plr.16.1518082916154; Thu, 08 Feb 2018 01:41:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518082916; cv=none; d=google.com; s=arc-20160816; b=FXtgKNoqryqqk7ilW7dQx+9xwct+Qo9zOHghakB3TxI2Hr4WfgCeaTKSWdUr2M+dns AvuD8+XGucLfeuSt8vJneZHi0X2exUAeG+iSCUzD1X82HGQxTEED7lF/IU14vyFJKLts P50aPvHXIqNBsfL81xgEQYBcRg80xJ52Z0RAfo1PZEtjc71jCLiBOiGYGn/qgP/h6Kj2 Jf7on9pCwvfaE1Xu5xiOTODjO7Lf/jkhJ5yZrys95VxaUd4QXEV120RpAwrd21MPnRBq fm19iozs72/fTFrQIr38Y5kQJWQNOHTSjCpoEsievFMpcUMlZ++RQU4wJIKA6l3VO021 ejqA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:cc:to:subject :message-id:date:from:references:in-reply-to:mime-version :dkim-signature:arc-authentication-results; bh=TRCyxjSjT1weIKgpYnJnzLiBMegh6ww5cg3ouNLnnKc=; b=MAvyyKRhNmyOSaSs3NEd8ucU4dch3yRsky69TxgUdCFbHtrTpwB/MpIh8lvQ/hOiwv ZqgE+8G9rNSRaHWxtZzRwqFTUFb6DNEL+H9pJg3sLXV+rYaMEw+VHmo44a+l3+6iDhL5 9LXn06ad14iIukKGg4UvljZUdEjVD0MWwBUsysbl8rfpu8Bz/hKgsTDIYZ6Ofpk55sgE zTU3aErhebhqfw6J7MgzEi/YsXkSTtHlzYIGcRoQegGh9Nb2cGfy16xjtoarFM0tTCBL oJicq36mtG8HXPAhcDXZraoblWfEWW7UNWy5NDSiFeRFhtvHqpJ74rTr9SzgcBIZW7vy YaeQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=DcQ1MNBo; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s187si2173519pgb.765.2018.02.08.01.41.42; Thu, 08 Feb 2018 01:41:56 -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; dkim=pass header.i=@linaro.org header.s=google header.b=DcQ1MNBo; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751788AbeBHJkz (ORCPT + 99 others); Thu, 8 Feb 2018 04:40:55 -0500 Received: from mail-qk0-f194.google.com ([209.85.220.194]:43437 "EHLO mail-qk0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751317AbeBHJkx (ORCPT ); Thu, 8 Feb 2018 04:40:53 -0500 Received: by mail-qk0-f194.google.com with SMTP id d129so1523934qke.10 for ; Thu, 08 Feb 2018 01:40:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=TRCyxjSjT1weIKgpYnJnzLiBMegh6ww5cg3ouNLnnKc=; b=DcQ1MNBoIcwoZnmKJMyDfTLu2gsTJhAI/EhVwZ/VE8EPLoaX2/6wL7r/w36E59W5nh 6vMHk4doEgObOvlYj+OLk9zJMt34z1UhbFXLEiPTKE6gzqC87QDk+MSz0p0M2OQWeyRp Y+Qmhj5qqoJr0yy0lqnY61S5Y8SGz3lNeie8g= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=TRCyxjSjT1weIKgpYnJnzLiBMegh6ww5cg3ouNLnnKc=; b=r5gou1rviFJPXMh9L8PV19vZipJI44GxKsVRNQJQiICWZvp1JKz3mngWCvev/5Fw4h xg4Xbv0p4BL/8iemZgCa/w2Xu3ypmqMXKrYBhL/dBWh9NAboLz5hSdvmABmOWPiRi5WC 1kM6JWsCrslJR38JuoRo2zAwmvIQnwMH4dX/HAXCX2dQvA2Z9THg5ICfs2BNQ7J1BjW3 p2k1LgBUMUgiYZA4iAY1pCtNa+BOfVrLHBoHePWcYxBbqs7LCWUrOt64YYwG4vw9mk6o whixqTGspUU+sDao51HmYKmwRBVYamqUL3cDJlEz8WnCNDu6Nvaafk00n9b8o9blU9RU DeTg== X-Gm-Message-State: APf1xPAiuz8CyI98FviE4NGP4GX1YKCBcSgEonlLziqPVnueQHKmH+j9 Yge/Fo1qZ7/IveJouCKZvHrZ/B3Hr0FSm0Y0NkoM6g== X-Received: by 10.55.42.23 with SMTP id q23mr102493qkh.80.1518082852642; Thu, 08 Feb 2018 01:40:52 -0800 (PST) MIME-Version: 1.0 Received: by 10.140.82.178 with HTTP; Thu, 8 Feb 2018 01:40:52 -0800 (PST) In-Reply-To: References: <20180201104243.20726-1-philippe.cornu@st.com> <20180201104243.20726-3-philippe.cornu@st.com> From: Benjamin Gaignard Date: Thu, 8 Feb 2018 10:40:52 +0100 Message-ID: Subject: Re: [PATCH v1 2/2] drm/stm: ltdc: remove non-alpha color formats on layer 2 for older hw To: Yannick FERTRE Cc: Philippe CORNU , Vincent ABRIOU , David Airlie , "dri-devel@lists.freedesktop.org" , "linux-kernel@vger.kernel.org" , Fabien DESSENNE , Mickael REULIER , Alexandre TORGUE Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 2018-02-06 10:13 GMT+01:00 Yannick FERTRE : > Reviewed-by: Yannick Fertr=C3=A9 > > > On 02/01/2018 11:42 AM, Philippe Cornu wrote: >> Hw older versions support non-alpha color formats derived >> from native alpha color formats only on the primary layer. >> For instance, RG16 native format without alpha works fine >> on 2nd layer but XR24 (derived color format from AR24) >> does not work on 2nd layer. >> >> Signed-off-by: Philippe Cornu Applied on drm-misc-next Benjamin >> --- >> drivers/gpu/drm/stm/ltdc.c | 20 ++++++++++++++++++++ >> drivers/gpu/drm/stm/ltdc.h | 1 + >> 2 files changed, 21 insertions(+) >> >> diff --git a/drivers/gpu/drm/stm/ltdc.c b/drivers/gpu/drm/stm/ltdc.c >> index f6f26fc0ae9e..1a3277e483d5 100644 >> --- a/drivers/gpu/drm/stm/ltdc.c >> +++ b/drivers/gpu/drm/stm/ltdc.c >> @@ -703,6 +703,11 @@ static void ltdc_plane_atomic_update(struct drm_pla= ne *plane, >> if (!fb->format->has_alpha) >> val =3D BF1_CA | BF2_1CA; >> >> + /* Manage hw-specific capabilities */ >> + if (ldev->caps.non_alpha_only_l1 && >> + plane->type !=3D DRM_PLANE_TYPE_PRIMARY) >> + val =3D BF1_PAXCA | BF2_1PAXCA; >> + >> reg_update_bits(ldev->regs, LTDC_L1BFCR + lofs, >> LXBFCR_BF2 | LXBFCR_BF1, val); >> >> @@ -785,6 +790,12 @@ static struct drm_plane *ltdc_plane_create(struct d= rm_device *ddev, >> drm_fmt_no_alpha =3D get_pixelformat_without_alpha(drm_fmt= ); >> if (!drm_fmt_no_alpha) >> continue; >> + >> + /* Manage hw-specific capabilities */ >> + if (ldev->caps.non_alpha_only_l1 && >> + type !=3D DRM_PLANE_TYPE_PRIMARY) >> + continue; >> + >> formats[nb_fmt++] =3D drm_fmt_no_alpha; >> } >> >> @@ -913,10 +924,19 @@ static int ltdc_get_caps(struct drm_device *ddev) >> case HWVER_10300: >> ldev->caps.reg_ofs =3D REG_OFS_NONE; >> ldev->caps.pix_fmt_hw =3D ltdc_pix_fmt_a0; >> + /* >> + * Hw older versions support non-alpha color formats deriv= ed >> + * from native alpha color formats only on the primary lay= er. >> + * For instance, RG16 native format without alpha works fi= ne >> + * on 2nd layer but XR24 (derived color format from AR24) >> + * does not work on 2nd layer. >> + */ >> + ldev->caps.non_alpha_only_l1 =3D true; >> break; >> case HWVER_20101: >> ldev->caps.reg_ofs =3D REG_OFS_4; >> ldev->caps.pix_fmt_hw =3D ltdc_pix_fmt_a1; >> + ldev->caps.non_alpha_only_l1 =3D false; >> break; >> default: >> return -ENODEV; >> diff --git a/drivers/gpu/drm/stm/ltdc.h b/drivers/gpu/drm/stm/ltdc.h >> index edd1c0a446d1..edb268129c54 100644 >> --- a/drivers/gpu/drm/stm/ltdc.h >> +++ b/drivers/gpu/drm/stm/ltdc.h >> @@ -17,6 +17,7 @@ struct ltdc_caps { >> u32 reg_ofs; /* register offset for applicable regs */ >> u32 bus_width; /* bus width (32 or 64 bits) */ >> const u32 *pix_fmt_hw; /* supported pixel formats */ >> + bool non_alpha_only_l1; /* non-native no-alpha formats on layer 1 = */ >> }; >> >> struct ltdc_device {