Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp2501898rdb; Fri, 8 Dec 2023 09:53:29 -0800 (PST) X-Google-Smtp-Source: AGHT+IHHpCVkTqvXT0XY7zqNWpgCdU8Vpsx5/vDbJMK6uCSgjd5lKYsfOwzTElqVyD7gRaGRBRXU X-Received: by 2002:a17:903:492:b0:1d0:c5f8:22d8 with SMTP id jj18-20020a170903049200b001d0c5f822d8mr342633plb.37.1702058009274; Fri, 08 Dec 2023 09:53:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702058009; cv=none; d=google.com; s=arc-20160816; b=IgDochY0VJ3kgOBUsTt2AKgy7A8Vp0TQAN1CXu3uavvj5fqVEpyOrkEDrk2Oaz0QNd DnefXzavoQqT9Lco2cVSD/hgjzPNBJ2SDvSG129fzU3EOPV7aOBPCPLc5apWPbvehpn1 kCs0BmZpAtPOzs/+VpIwz96dsn5bgqYcM+jFTazTD7+4ogI0kxypBuX1njoRnOf6s8RP kHiFj7Oa89MeXMW772poHaoQ1IR2q/7JAxov12SfZFijvbr1aE25TQ72IUbxiiw1O8t7 y+x7sVKM4daFEZyPf3zMh79Xr7DQqKFsho37hsvjrMAPpcVXm3xEcYP+FI+TJVDMg4Cj FfUA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=aOeljEYHqNEgKhz/BD6fDUZMLkHsi4yd87IWatixXCA=; fh=rzaLygvkokr/PKBadtUs7spRk1TCu9TThEeaU/6cz+o=; b=FeLF0/wPRoG6RJOjKk6M+uQoxwprntBnB7mepSG+u6e3toToCRnsWsJwkJZ76SygCo 6rItomH7N751FCCl0h/2hX2R3EcF6Ezy9e5oQQhti8nib+TXiKszkxLWrsIgjFLAx2MV hMpCqjLSYbOzPsoHjgjEYrx4I4ETYcax3GTqkSTnbuZgvrN3ANB6ucQL2Ar+Oi/8T9yk a3EB9GCUCx21Swab34OokqUSxK0oIRUVHgOG5u72feZwmQEV79Xnt7yxYVihSaf8y/1o S0xMK5CuJNjZxJP09x8pJfEJqC6X0gicuxs9vgS3mqYJhEgGQsKFl3QjxW1D5ujpLwCG CFEQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=Pm99gtXZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id b13-20020a170902d50d00b001d0b5aa3000si1969835plg.456.2023.12.08.09.53.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Dec 2023 09:53:29 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=Pm99gtXZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 48A3D81DE3B7; Fri, 8 Dec 2023 09:53:26 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1574470AbjLHRxJ (ORCPT + 99 others); Fri, 8 Dec 2023 12:53:09 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46418 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1574152AbjLHRxH (ORCPT ); Fri, 8 Dec 2023 12:53:07 -0500 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 71771D54; Fri, 8 Dec 2023 09:53:13 -0800 (PST) Received: from pps.filterd (m0279872.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 3B8HmRuI004859; Fri, 8 Dec 2023 17:53:06 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h=message-id : date : mime-version : subject : to : cc : references : from : in-reply-to : content-type : content-transfer-encoding; s=qcppdkim1; bh=aOeljEYHqNEgKhz/BD6fDUZMLkHsi4yd87IWatixXCA=; b=Pm99gtXZ73M74T/25u/BMy31HmcnsfrDH5OGUCGIBUHuXkTgoRo6Qn4qacSD4XlX2NEA iR0I/iD2UlF3Tu9ZU+9Y5qRjP+4A+OvPsnFi081sduLBpl5GEqYECDyQPd88YPfo2Rh5 hq/Ltgz/pgHziDcEHjVRkIQpB9uQXb+Qj9/Rs5sP1dO+r7NQR3D8Jyp7T9/AxntawWws obYyEJZ+2pZokdEVvtKr3zl8NFhTG9Qr1iaX8wRCCS98mhbVnPE642pE1Dd4E/HNeLUq sjKG+Y7cZX7DnHxlJl1AyxU1+x1hHFoNnt/HPFtf/66ZO+7f4lsue3nQ14wlL4Mol9hp FA== Received: from nalasppmta02.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3uuj96jtt0-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 08 Dec 2023 17:53:06 +0000 Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA02.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 3B8Hr53C021554 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 8 Dec 2023 17:53:05 GMT Received: from [10.110.30.94] (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.40; Fri, 8 Dec 2023 09:53:02 -0800 Message-ID: <8eea4a8e-0c70-3768-79f0-1a2bfe083ed7@quicinc.com> Date: Fri, 8 Dec 2023 09:53:00 -0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0 Subject: Re: [PATCH v2 15/16] drm/msm/dpu: introduce separate wb2_format arrays for rgb and yuv Content-Language: en-US To: Dmitry Baryshkov CC: , Rob Clark , "Sean Paul" , Marijn Suijten , "David Airlie" , Daniel Vetter , , , , , References: <20231208050641.32582-1-quic_abhinavk@quicinc.com> <20231208050641.32582-16-quic_abhinavk@quicinc.com> From: Abhinav Kumar In-Reply-To: Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nalasex01a.na.qualcomm.com (10.47.209.196) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-GUID: 051TRLS3deczFWlARKUQrV5xBODbhbIn X-Proofpoint-ORIG-GUID: 051TRLS3deczFWlARKUQrV5xBODbhbIn X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.997,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-12-08_11,2023-12-07_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 spamscore=0 mlxlogscore=801 malwarescore=0 phishscore=0 bulkscore=0 impostorscore=0 lowpriorityscore=0 adultscore=0 mlxscore=0 priorityscore=1501 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2311290000 definitions=main-2312080147 X-Spam-Status: No, score=-3.0 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Fri, 08 Dec 2023 09:53:26 -0800 (PST) On 12/8/2023 3:44 AM, Dmitry Baryshkov wrote: > On Fri, 8 Dec 2023 at 07:07, Abhinav Kumar wrote: >> >> Lets rename the existing wb2_formats array wb2_formats_rgb to indicate >> that it has only RGB formats and can be used on any chipset having a WB >> block. >> >> Introduce a new wb2_formats_rgb_yuv array to the catalog to >> indicate support for YUV formats to writeback in addition to RGB. >> >> Chipsets which have support for CDM block will use the newly added >> wb2_formats_rgb_yuv array. > > This means that the catalog can go out of sync, if one adds a CDM > block but doesn't update wb_formats and vice versa. > Can we deduce the format list from the WB code? Is the format list > really static or does it change between platforms (please keep msm8996 > / msm8998 in mind). > Yes this is a valid concern. catalog could potentially go out of sync. I checked a few chipsets now and the WB formats didnt change among them. I do need to check more chipsets but downstream does not maintain this in devicetree which means we can just move these arrays to WB code instead of maintaining them in the catalog. We will still need to maintain two arrays. One to be used if CDM block has been added and the other if not. I must confess one point though. I have not seen any chipset yet where WB block is present but CDM block is not. So at this point, the only purpose of the two arrays will be till the point where CDM blk has been added to all the required chipsets in the catalog. Then we can drop the RGB only array and maintain the one which has all formats. >> >> Signed-off-by: Abhinav Kumar >> --- >> .../msm/disp/dpu1/catalog/dpu_10_0_sm8650.h | 4 +- >> .../msm/disp/dpu1/catalog/dpu_6_0_sm8250.h | 4 +- >> .../msm/disp/dpu1/catalog/dpu_6_2_sc7180.h | 4 +- >> .../msm/disp/dpu1/catalog/dpu_7_2_sc7280.h | 4 +- >> .../msm/disp/dpu1/catalog/dpu_9_0_sm8550.h | 4 +- >> .../gpu/drm/msm/disp/dpu1/dpu_hw_catalog.c | 37 ++++++++++++++++++- >> 6 files changed, 46 insertions(+), 11 deletions(-) >> >> diff --git a/drivers/gpu/drm/msm/disp/dpu1/catalog/dpu_10_0_sm8650.h b/drivers/gpu/drm/msm/disp/dpu1/catalog/dpu_10_0_sm8650.h >> index 04d2a73dd942..eb5dfff2ec4f 100644 >> --- a/drivers/gpu/drm/msm/disp/dpu1/catalog/dpu_10_0_sm8650.h >> +++ b/drivers/gpu/drm/msm/disp/dpu1/catalog/dpu_10_0_sm8650.h >> @@ -341,8 +341,8 @@ static const struct dpu_wb_cfg sm8650_wb[] = { >> .name = "wb_2", .id = WB_2, >> .base = 0x65000, .len = 0x2c8, >> .features = WB_SM8250_MASK, >> - .format_list = wb2_formats, >> - .num_formats = ARRAY_SIZE(wb2_formats), >> + .format_list = wb2_formats_rgb, >> + .num_formats = ARRAY_SIZE(wb2_formats_rgb), >> .xin_id = 6, >> .vbif_idx = VBIF_RT, >> .maxlinewidth = 4096, >> diff --git a/drivers/gpu/drm/msm/disp/dpu1/catalog/dpu_6_0_sm8250.h b/drivers/gpu/drm/msm/disp/dpu1/catalog/dpu_6_0_sm8250.h >> index 58b0f50518c8..a57d50b1f028 100644 >> --- a/drivers/gpu/drm/msm/disp/dpu1/catalog/dpu_6_0_sm8250.h >> +++ b/drivers/gpu/drm/msm/disp/dpu1/catalog/dpu_6_0_sm8250.h >> @@ -336,8 +336,8 @@ static const struct dpu_wb_cfg sm8250_wb[] = { >> .name = "wb_2", .id = WB_2, >> .base = 0x65000, .len = 0x2c8, >> .features = WB_SM8250_MASK, >> - .format_list = wb2_formats, >> - .num_formats = ARRAY_SIZE(wb2_formats), >> + .format_list = wb2_formats_rgb_yuv, >> + .num_formats = ARRAY_SIZE(wb2_formats_rgb_yuv), >> .clk_ctrl = DPU_CLK_CTRL_WB2, >> .xin_id = 6, >> .vbif_idx = VBIF_RT, >> diff --git a/drivers/gpu/drm/msm/disp/dpu1/catalog/dpu_6_2_sc7180.h b/drivers/gpu/drm/msm/disp/dpu1/catalog/dpu_6_2_sc7180.h >> index bcfedfc8251a..7382ebb6e5b2 100644 >> --- a/drivers/gpu/drm/msm/disp/dpu1/catalog/dpu_6_2_sc7180.h >> +++ b/drivers/gpu/drm/msm/disp/dpu1/catalog/dpu_6_2_sc7180.h >> @@ -157,8 +157,8 @@ static const struct dpu_wb_cfg sc7180_wb[] = { >> .name = "wb_2", .id = WB_2, >> .base = 0x65000, .len = 0x2c8, >> .features = WB_SM8250_MASK, >> - .format_list = wb2_formats, >> - .num_formats = ARRAY_SIZE(wb2_formats), >> + .format_list = wb2_formats_rgb, >> + .num_formats = ARRAY_SIZE(wb2_formats_rgb), >> .clk_ctrl = DPU_CLK_CTRL_WB2, >> .xin_id = 6, >> .vbif_idx = VBIF_RT, >> diff --git a/drivers/gpu/drm/msm/disp/dpu1/catalog/dpu_7_2_sc7280.h b/drivers/gpu/drm/msm/disp/dpu1/catalog/dpu_7_2_sc7280.h >> index 19c2b7454796..2f153e0b5c6a 100644 >> --- a/drivers/gpu/drm/msm/disp/dpu1/catalog/dpu_7_2_sc7280.h >> +++ b/drivers/gpu/drm/msm/disp/dpu1/catalog/dpu_7_2_sc7280.h >> @@ -169,8 +169,8 @@ static const struct dpu_wb_cfg sc7280_wb[] = { >> .name = "wb_2", .id = WB_2, >> .base = 0x65000, .len = 0x2c8, >> .features = WB_SM8250_MASK, >> - .format_list = wb2_formats, >> - .num_formats = ARRAY_SIZE(wb2_formats), >> + .format_list = wb2_formats_rgb_yuv, >> + .num_formats = ARRAY_SIZE(wb2_formats_rgb_yuv), >> .clk_ctrl = DPU_CLK_CTRL_WB2, >> .xin_id = 6, >> .vbif_idx = VBIF_RT, >> diff --git a/drivers/gpu/drm/msm/disp/dpu1/catalog/dpu_9_0_sm8550.h b/drivers/gpu/drm/msm/disp/dpu1/catalog/dpu_9_0_sm8550.h >> index bf56265967c0..ad48defa154f 100644 >> --- a/drivers/gpu/drm/msm/disp/dpu1/catalog/dpu_9_0_sm8550.h >> +++ b/drivers/gpu/drm/msm/disp/dpu1/catalog/dpu_9_0_sm8550.h >> @@ -315,8 +315,8 @@ static const struct dpu_wb_cfg sm8550_wb[] = { >> .name = "wb_2", .id = WB_2, >> .base = 0x65000, .len = 0x2c8, >> .features = WB_SM8250_MASK, >> - .format_list = wb2_formats, >> - .num_formats = ARRAY_SIZE(wb2_formats), >> + .format_list = wb2_formats_rgb, >> + .num_formats = ARRAY_SIZE(wb2_formats_rgb), >> .xin_id = 6, >> .vbif_idx = VBIF_RT, >> .maxlinewidth = 4096, >> diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_catalog.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_catalog.c >> index 1be3156cde05..c52cac7a2288 100644 >> --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_catalog.c >> +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_catalog.c >> @@ -202,7 +202,7 @@ static const u32 rotation_v2_formats[] = { >> /* TODO add formats after validation */ >> }; >> >> -static const uint32_t wb2_formats[] = { >> +static const uint32_t wb2_formats_rgb[] = { >> DRM_FORMAT_RGB565, >> DRM_FORMAT_BGR565, >> DRM_FORMAT_RGB888, >> @@ -236,6 +236,41 @@ static const uint32_t wb2_formats[] = { >> DRM_FORMAT_XBGR4444, >> }; >> >> +static const uint32_t wb2_formats_rgb_yuv[] = { >> + DRM_FORMAT_RGB565, >> + DRM_FORMAT_BGR565, >> + DRM_FORMAT_RGB888, >> + DRM_FORMAT_ARGB8888, >> + DRM_FORMAT_RGBA8888, >> + DRM_FORMAT_ABGR8888, >> + DRM_FORMAT_XRGB8888, >> + DRM_FORMAT_RGBX8888, >> + DRM_FORMAT_XBGR8888, >> + DRM_FORMAT_ARGB1555, >> + DRM_FORMAT_RGBA5551, >> + DRM_FORMAT_XRGB1555, >> + DRM_FORMAT_RGBX5551, >> + DRM_FORMAT_ARGB4444, >> + DRM_FORMAT_RGBA4444, >> + DRM_FORMAT_RGBX4444, >> + DRM_FORMAT_XRGB4444, >> + DRM_FORMAT_BGR565, >> + DRM_FORMAT_BGR888, >> + DRM_FORMAT_ABGR8888, >> + DRM_FORMAT_BGRA8888, >> + DRM_FORMAT_BGRX8888, >> + DRM_FORMAT_XBGR8888, >> + DRM_FORMAT_ABGR1555, >> + DRM_FORMAT_BGRA5551, >> + DRM_FORMAT_XBGR1555, >> + DRM_FORMAT_BGRX5551, >> + DRM_FORMAT_ABGR4444, >> + DRM_FORMAT_BGRA4444, >> + DRM_FORMAT_BGRX4444, >> + DRM_FORMAT_XBGR4444, >> + DRM_FORMAT_NV12, >> +}; >> + >> /************************************************************* >> * SSPP sub blocks config >> *************************************************************/ >> -- >> 2.40.1 >> > >