Received: by 2002:a05:6358:c692:b0:131:369:b2a3 with SMTP id fe18csp1575850rwb; Fri, 28 Jul 2023 11:24:20 -0700 (PDT) X-Google-Smtp-Source: APBJJlHpIA3DgSNcQLTmopk4N6ZXAIdWAy8ympNWD2zXJRfiSrygTExafNYK7I89JXslMg96A/PJ X-Received: by 2002:a05:6808:1708:b0:3a3:baf8:5b8a with SMTP id bc8-20020a056808170800b003a3baf85b8amr4227179oib.13.1690568660471; Fri, 28 Jul 2023 11:24:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690568660; cv=none; d=google.com; s=arc-20160816; b=h7qE09YOXphRBS9NJrEAarQwLNkVcC3MH0l+wPZUQa/Jimk1Fh4wDaOKaRm3Qa6gsc Il4YfbYRupU+91rEc/qudvj2v5m2F1ckJl1HF9Kgf91yPSWUQtOGPLxUxSMQDs2g+aSs hAhLj0t7IIEgTpYnxB8ekb0oNSV+cizZw+LsCfMZrd0JFj2IOcebL3OTfZ2FJB1kECBa Fy/FoWURqtUy6t2MXqmi5vJamVdTXyJGGwl/LJ0qBXx4Dtlo9YY2CNk2ECoIzh/VRUY7 ZuLfW5UjYuK3w2OQNItT4sNps+Gdex/07eN2B+JifyTgrA3j5Bct8Wrpj8siMTCY9OCz 36DA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=hJNADWSnb8QpOtbLXd4223ova8BIKtB/kc5vzGW+xtA=; fh=uR21f6Y7gVloD7/Gth73scWCecBWQpvog8nrDVRX+3A=; b=upbdQEMbp2AmtQ08d0V/RWcYpTB0xqAjAPvvEK8ozOwXdRAFXRZ6utu5OrXO+9fe8s +NiUIxWuQ56hQBLDWCjO9Ik/yIqjareeuDxDvXKBrOcpMI1Nspy+QahC2EOmN7RrcfBI dim3Y5qWUIsaRpYqYRU7t0K21eb0UzUsnjHzGO+IyBuWvqB39QPJ9J8oSPmjryJ0qRY4 ls3hGerGQBANcMRZCN59iy0Twl3809OS0NbQkyIxZAkJLfqBBMgDjjvdCYBcByxVSGAH 7RVgqNLLGZPnCC3QriFxurj1Logca/th9cgMyf2XuE2ens8WLUIHDlHf7xGk3wEUmpu/ 1GHw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=WQLsguP1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g2-20020a17090a9b8200b00267eefee39fsi4981675pjp.131.2023.07.28.11.24.07; Fri, 28 Jul 2023 11:24:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=WQLsguP1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235985AbjG1RDn (ORCPT + 99 others); Fri, 28 Jul 2023 13:03:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36568 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235680AbjG1RDc (ORCPT ); Fri, 28 Jul 2023 13:03:32 -0400 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6C3C63A8C; Fri, 28 Jul 2023 10:03:21 -0700 (PDT) Received: from pps.filterd (m0279862.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 36SFFPTC019690; Fri, 28 Jul 2023 17:02:56 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h=from : date : subject : mime-version : content-type : content-transfer-encoding : message-id : references : in-reply-to : to : cc; s=qcppdkim1; bh=hJNADWSnb8QpOtbLXd4223ova8BIKtB/kc5vzGW+xtA=; b=WQLsguP1n20c4mfWAYngsHVGF1FbgNOs5XiYR7VcotbvEvOR7JO7hxFM8vUxWTB6Ktzv I5MjxzA+zm651O0VW2L2PUORKTkNO5NEeet43X0HWSrkzsbr98x1YTN5DgNs6qh6hztv yRZ9lvm6wlKnT+igrr6OhNWe47Q2SLSgoWANjnsebXR7NwOBNhquWL1D1ps6Psp8Xeho f6/7u7gE9V9RcLyC0PtoX4PzcULm6mQExe1Zy9hlgjUPIFuF9BqYWmmYYVTzAV8gyYgu DoyMcwAbaGn+ptrrqYJ1oe43OPCGe1K772BDnpkqf5XHNWn6s6JiLwLOWVmNePYqAd+G GQ== Received: from nasanppmta02.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3s469hhhgr-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 28 Jul 2023 17:02:56 +0000 Received: from nasanex01b.na.qualcomm.com (nasanex01b.na.qualcomm.com [10.46.141.250]) by NASANPPMTA02.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 36SH2tqG024430 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 28 Jul 2023 17:02:55 GMT Received: from jesszhan-linux.qualcomm.com (10.80.80.8) by nasanex01b.na.qualcomm.com (10.46.141.250) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.30; Fri, 28 Jul 2023 10:02:55 -0700 From: Jessica Zhang Date: Fri, 28 Jul 2023 10:02:18 -0700 Subject: [PATCH RFC v5 09/10] drm/msm/dpu: Use DRM solid_fill property MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-ID: <20230728-solid-fill-v5-9-053dbefa909c@quicinc.com> References: <20230728-solid-fill-v5-0-053dbefa909c@quicinc.com> In-Reply-To: <20230728-solid-fill-v5-0-053dbefa909c@quicinc.com> To: Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter , Rob Clark , Dmitry Baryshkov , "Sean Paul" , Marijn Suijten CC: , , , , , , , , , , , Jessica Zhang X-Mailer: b4 0.13-dev-034f2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1690563772; l=2736; i=quic_jesszhan@quicinc.com; s=20230329; h=from:subject:message-id; bh=mCOIAV7DV91a2p7k0jB8pDYlNQo+wL3EiDjmPUIw/l8=; b=6u3q9ZyoFxhB7hKivm4e0+YoziR5whEKqNwU9zC1rEVvhj5RuDQPFtBCtk9m8hDiDcZtRMaiv Ts+QEV9zUHrAu1P8GP6u8jpUz/ZPtstMi+KDaOF+cgwT+YyYPaGRlh0 X-Developer-Key: i=quic_jesszhan@quicinc.com; a=ed25519; pk=gAUCgHZ6wTJOzQa3U0GfeCDH7iZLlqIEPo4rrjfDpWE= X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nasanex01b.na.qualcomm.com (10.46.141.250) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-ORIG-GUID: MdNbo0db1hA_n6azO-Qz8M6R5rDlnsmP X-Proofpoint-GUID: MdNbo0db1hA_n6azO-Qz8M6R5rDlnsmP X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.591,FMLib:17.11.176.26 definitions=2023-07-27_10,2023-07-26_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 priorityscore=1501 impostorscore=0 malwarescore=0 phishscore=0 adultscore=0 clxscore=1015 mlxlogscore=999 mlxscore=0 spamscore=0 lowpriorityscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2306200000 definitions=main-2307280154 X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Drop DPU_PLANE_COLOR_FILL_FLAG and check the DRM solid_fill property to determine if the plane is solid fill. In addition drop the DPU plane color_fill field as we can now use drm_plane_state.solid_fill instead, and pass in drm_plane_state.alpha to _dpu_plane_color_fill_pipe() to allow userspace to configure the alpha value for the solid fill color. Reviewed-by: Dmitry Baryshkov Signed-off-by: Jessica Zhang --- drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c index 114c803ff99b..95fc0394d13e 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c @@ -42,7 +42,6 @@ #define SHARP_SMOOTH_THR_DEFAULT 8 #define SHARP_NOISE_THR_DEFAULT 2 -#define DPU_PLANE_COLOR_FILL_FLAG BIT(31) #define DPU_ZPOS_MAX 255 /* @@ -82,7 +81,6 @@ struct dpu_plane { enum dpu_sspp pipe; - uint32_t color_fill; bool is_error; bool is_rt_pipe; const struct dpu_mdss_cfg *catalog; @@ -606,6 +604,20 @@ static void _dpu_plane_color_fill_pipe(struct dpu_plane_state *pstate, _dpu_plane_setup_scaler(pipe, fmt, true, &pipe_cfg, pstate->rotation); } +static uint32_t _dpu_plane_get_bgr_fill_color(struct drm_solid_fill solid_fill) +{ + uint32_t ret = 0; + uint8_t b = solid_fill.b >> 24; + uint8_t g = solid_fill.g >> 24; + uint8_t r = solid_fill.r >> 24; + + ret |= b << 16; + ret |= g << 8; + ret |= r; + + return ret; +} + /** * _dpu_plane_color_fill - enables color fill on plane * @pdpu: Pointer to DPU plane object @@ -977,9 +989,9 @@ void dpu_plane_flush(struct drm_plane *plane) if (pdpu->is_error) /* force white frame with 100% alpha pipe output on error */ _dpu_plane_color_fill(pdpu, 0xFFFFFF, 0xFF); - else if (pdpu->color_fill & DPU_PLANE_COLOR_FILL_FLAG) - /* force 100% alpha */ - _dpu_plane_color_fill(pdpu, pdpu->color_fill, 0xFF); + else if (drm_plane_solid_fill_enabled(plane->state)) + _dpu_plane_color_fill(pdpu, _dpu_plane_get_bgr_fill_color(plane->state->solid_fill), + plane->state->alpha); else { dpu_plane_flush_csc(pdpu, &pstate->pipe); dpu_plane_flush_csc(pdpu, &pstate->r_pipe); @@ -1024,7 +1036,7 @@ static void dpu_plane_sspp_update_pipe(struct drm_plane *plane, } /* override for color fill */ - if (pdpu->color_fill & DPU_PLANE_COLOR_FILL_FLAG) { + if (drm_plane_solid_fill_enabled(plane->state)) { _dpu_plane_set_qos_ctrl(plane, pipe, false); /* skip remaining processing on color fill */ -- 2.41.0