Message ID | 20231212002245.23715-2-quic_abhinavk@quicinc.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:bcd1:0:b0:403:3b70:6f57 with SMTP id r17csp7422396vqy; Mon, 11 Dec 2023 16:23:12 -0800 (PST) X-Google-Smtp-Source: AGHT+IHP/jG4ioVYe6AEATN8SJZiI22iExne4Uab0y8mENH/auKO3KYW5odaqc68Nya73iUO4mY+ X-Received: by 2002:a05:6871:146:b0:1fb:75b:2fd9 with SMTP id z6-20020a056871014600b001fb075b2fd9mr6378375oab.112.1702340591962; Mon, 11 Dec 2023 16:23:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702340591; cv=none; d=google.com; s=arc-20160816; b=Dq/sP0F61pbIMOmO77pFRfN18eHS3MI7tWmaYojs7BGaHqt4xZ6PPSICEEYM9WgBbO Bf1y+RGk95/YCQSnIKhj+g1yiLrhlbb3HdXmkyWnmwAy2iJbHWqdE9W7HgFrxJcSNMMm /bDW+ifVfDOl1uWFeCNWi33ZJ30Xu+MbOGpgbtxPUdA9DLjQqF4dSBWLQbNvKYuouQIu d9KRMlx/b97/fnK1ytytVG5lD0eUtHn8dtVsMc++ZuXllYPQzY4TnmYt2g2boxQVsfS1 RZaSVjS1H5x2KVvfi0++84Gd8WqjDD2a+Url1N2bEy+PISHpB9u4tO0cstzpMYSrz4OT ArBQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=m7uuE+uogHCmFs/uvEZw6IXuyZvtIb2YneOELmaFFoY=; fh=2XyQDqDG0wz2VEIrVbLmdsbSBBAARfl7BOJG4nJ/HZo=; b=sIoARoF4hixPOAyAw7TFId44P07TG13epRCpmx0EHZIx35sjyKUI3bexM7OuLfsB/k tF9AOOuhkWLpKinNySMIJvWJvGlLcd1t/RL4csaiL/SJ1BdlmmNdBaEXNQCxy4bSE3NJ 80pGSSRDvBWkNZPmDtfwKeiXxMb/pQAf5uqua+M0BHTdO0W6S/SX+B7JX5c0jfldzccJ N9+AyZsIT0cEwN+BmamcZYzK3bpcVc3IJ4I3EaygTRtd5Bt1OE9icJbNCCrt2ybP3sKk rI5q1gC/MMk8EdwZssIU6wIZshuAThgElpTP8Wy0d4BsmjvGz4pwGChr8wk9U9rdkli2 VhOg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=Llhpf2m6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 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 morse.vger.email (morse.vger.email. [23.128.96.31]) by mx.google.com with ESMTPS id h2-20020a654042000000b005c66cf231d7si6874603pgp.336.2023.12.11.16.23.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Dec 2023 16:23:11 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) client-ip=23.128.96.31; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=Llhpf2m6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 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 morse.vger.email (Postfix) with ESMTP id B4D9A80C6194; Mon, 11 Dec 2023 16:23:08 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345402AbjLLAXA (ORCPT <rfc822;dexuan.linux@gmail.com> + 99 others); Mon, 11 Dec 2023 19:23:00 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45524 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230235AbjLLAW6 (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Mon, 11 Dec 2023 19:22:58 -0500 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7CE07A2; Mon, 11 Dec 2023 16:23:05 -0800 (PST) Received: from pps.filterd (m0279866.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 3BBM65UT007262; Tue, 12 Dec 2023 00:22:58 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding:content-type; s= qcppdkim1; bh=m7uuE+uogHCmFs/uvEZw6IXuyZvtIb2YneOELmaFFoY=; b=Ll hpf2m6vvaOplMcSdp4Njq4GOA5h4J6ftHce8F0mgkcxjnNQUepwegTg7dCnLcXO4 r11uuLhBLjGUIcd+f9qJOIAH1WBKI5NQ+lEleeLQ5fAw2ByRennqb9CZUC+r68vG moy4WAUNnRrmG0bVGTUEvRezm9nEFNmacIgu/L5fW2gRsZEKp8gLM/UVs6MAGR9Q m+kDAiNBP6v92V0qT15DdrtLlAN9LYR4Qhmox1X4s0xZ9nJFDhkzw1HOpzYOKog6 tz5HZYeGExNcGr3oLhrYaPWl9FPsvPd2s6vkI5W0oA8fRoKtAhzwasCoOkYPjGQ0 rDsT6v87rxeYC/wE6big== Received: from nalasppmta05.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3ux25u1k8s-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 12 Dec 2023 00:22:58 +0000 (GMT) Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA05.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 3BC0MveF022319 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 12 Dec 2023 00:22:57 GMT Received: from abhinavk-linux.qualcomm.com (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; Mon, 11 Dec 2023 16:22:56 -0800 From: Abhinav Kumar <quic_abhinavk@quicinc.com> To: <freedreno@lists.freedesktop.org>, Rob Clark <robdclark@gmail.com>, Abhinav Kumar <quic_abhinavk@quicinc.com>, Dmitry Baryshkov <dmitry.baryshkov@linaro.org>, Sean Paul <sean@poorly.run>, Marijn Suijten <marijn.suijten@somainline.org>, David Airlie <airlied@gmail.com>, "Daniel Vetter" <daniel@ffwll.ch> CC: <dri-devel@lists.freedesktop.org>, <seanpaul@chromium.org>, <quic_jesszhan@quicinc.com>, <linux-arm-msm@vger.kernel.org>, <linux-kernel@vger.kernel.org> Subject: [PATCH v3 01/15] drm/msm/dpu: add formats check for writeback encoder Date: Mon, 11 Dec 2023 16:22:31 -0800 Message-ID: <20231212002245.23715-2-quic_abhinavk@quicinc.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20231212002245.23715-1-quic_abhinavk@quicinc.com> References: <20231212002245.23715-1-quic_abhinavk@quicinc.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain 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-ORIG-GUID: T7RmX26udptZGMGBKTGcvH25HJ8YnxuU X-Proofpoint-GUID: T7RmX26udptZGMGBKTGcvH25HJ8YnxuU 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-09_01,2023-12-07_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 spamscore=0 mlxscore=0 bulkscore=0 lowpriorityscore=0 phishscore=0 impostorscore=0 malwarescore=0 suspectscore=0 adultscore=0 priorityscore=1501 mlxlogscore=967 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2311290000 definitions=main-2312120000 X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, 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 morse.vger.email Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Mon, 11 Dec 2023 16:23:08 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1785033488396851621 X-GMAIL-MSGID: 1785033488396851621 |
Series |
[v3,01/15] drm/msm/dpu: add formats check for writeback encoder
|
|
Commit Message
Abhinav Kumar
Dec. 12, 2023, 12:22 a.m. UTC
In preparation for adding more formats to dpu writeback add
format validation to it to fail any unsupported formats.
changes in v3:
- rebase on top of msm-next
- replace drm_atomic_helper_check_wb_encoder_state() with
drm_atomic_helper_check_wb_connector_state() due to the
rebase
changes in v2:
- correct some grammar in the commit text
Fixes: d7d0e73f7de3 ("drm/msm/dpu: introduce the dpu_encoder_phys_* for writeback")
Signed-off-by: Abhinav Kumar <quic_abhinavk@quicinc.com>
---
drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_wb.c | 7 +++++++
1 file changed, 7 insertions(+)
Comments
On Tue, 12 Dec 2023 at 02:23, Abhinav Kumar <quic_abhinavk@quicinc.com> wrote: > > In preparation for adding more formats to dpu writeback add > format validation to it to fail any unsupported formats. > > changes in v3: > - rebase on top of msm-next > - replace drm_atomic_helper_check_wb_encoder_state() with > drm_atomic_helper_check_wb_connector_state() due to the > rebase > > changes in v2: > - correct some grammar in the commit text > > Fixes: d7d0e73f7de3 ("drm/msm/dpu: introduce the dpu_encoder_phys_* for writeback") > Signed-off-by: Abhinav Kumar <quic_abhinavk@quicinc.com> > --- > drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_wb.c | 7 +++++++ > 1 file changed, 7 insertions(+) > > diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_wb.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_wb.c > index bb94909caa25..425415d45ec1 100644 > --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_wb.c > +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_wb.c > @@ -272,6 +272,7 @@ static int dpu_encoder_phys_wb_atomic_check( > { > struct drm_framebuffer *fb; > const struct drm_display_mode *mode = &crtc_state->mode; > + int ret; > > DPU_DEBUG("[atomic_check:%d, \"%s\",%d,%d]\n", > phys_enc->hw_wb->idx, mode->name, mode->hdisplay, mode->vdisplay); > @@ -308,6 +309,12 @@ static int dpu_encoder_phys_wb_atomic_check( > return -EINVAL; > } > > + ret = drm_atomic_helper_check_wb_connector_state(conn_state->connector, conn_state->state); > + if (ret < 0) { > + DPU_ERROR("invalid pixel format %p4cc\n", &fb->format->format); > + return ret; > + } There is no guarantee that there will be no other checks added to this helper. So, I think this message is incorrect. If you wish, you can promote the level of the message in the helper itself. On the other hand, we rarely print such messages by default. Most of the checks use drm_dbg. > + > return 0; > } > > -- > 2.40.1 >
On 12/11/2023 10:40 PM, Dmitry Baryshkov wrote: > On Tue, 12 Dec 2023 at 02:23, Abhinav Kumar <quic_abhinavk@quicinc.com> wrote: >> >> In preparation for adding more formats to dpu writeback add >> format validation to it to fail any unsupported formats. >> >> changes in v3: >> - rebase on top of msm-next >> - replace drm_atomic_helper_check_wb_encoder_state() with >> drm_atomic_helper_check_wb_connector_state() due to the >> rebase >> >> changes in v2: >> - correct some grammar in the commit text >> >> Fixes: d7d0e73f7de3 ("drm/msm/dpu: introduce the dpu_encoder_phys_* for writeback") >> Signed-off-by: Abhinav Kumar <quic_abhinavk@quicinc.com> >> --- >> drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_wb.c | 7 +++++++ >> 1 file changed, 7 insertions(+) >> >> diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_wb.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_wb.c >> index bb94909caa25..425415d45ec1 100644 >> --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_wb.c >> +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_wb.c >> @@ -272,6 +272,7 @@ static int dpu_encoder_phys_wb_atomic_check( >> { >> struct drm_framebuffer *fb; >> const struct drm_display_mode *mode = &crtc_state->mode; >> + int ret; >> >> DPU_DEBUG("[atomic_check:%d, \"%s\",%d,%d]\n", >> phys_enc->hw_wb->idx, mode->name, mode->hdisplay, mode->vdisplay); >> @@ -308,6 +309,12 @@ static int dpu_encoder_phys_wb_atomic_check( >> return -EINVAL; >> } >> >> + ret = drm_atomic_helper_check_wb_connector_state(conn_state->connector, conn_state->state); >> + if (ret < 0) { >> + DPU_ERROR("invalid pixel format %p4cc\n", &fb->format->format); >> + return ret; >> + } > > There is no guarantee that there will be no other checks added to this > helper. So, I think this message is incorrect. If you wish, you can > promote the level of the message in the helper itself. > On the other hand, we rarely print such messages by default. Most of > the checks use drm_dbg. > hmm...actually drm_atomic_helper_check_wb_connector_state() already has a debug message to indicate invalid pixel formats. You are right, i should perhaps just say that "atomic_check failed" or something. I can make this a DPU_DEBUG. Actually I didnt know that we are not supposed to print out atomic_check() errors. Is it perhaps because its okay for check to fail? But then we would not know why it failed. >> + >> return 0; >> } >> >> -- >> 2.40.1 >> > >
On Tue, 12 Dec 2023 at 19:17, Abhinav Kumar <quic_abhinavk@quicinc.com> wrote: > > > > On 12/11/2023 10:40 PM, Dmitry Baryshkov wrote: > > On Tue, 12 Dec 2023 at 02:23, Abhinav Kumar <quic_abhinavk@quicinc.com> wrote: > >> > >> In preparation for adding more formats to dpu writeback add > >> format validation to it to fail any unsupported formats. > >> > >> changes in v3: > >> - rebase on top of msm-next > >> - replace drm_atomic_helper_check_wb_encoder_state() with > >> drm_atomic_helper_check_wb_connector_state() due to the > >> rebase > >> > >> changes in v2: > >> - correct some grammar in the commit text > >> > >> Fixes: d7d0e73f7de3 ("drm/msm/dpu: introduce the dpu_encoder_phys_* for writeback") > >> Signed-off-by: Abhinav Kumar <quic_abhinavk@quicinc.com> > >> --- > >> drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_wb.c | 7 +++++++ > >> 1 file changed, 7 insertions(+) > >> > >> diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_wb.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_wb.c > >> index bb94909caa25..425415d45ec1 100644 > >> --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_wb.c > >> +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_wb.c > >> @@ -272,6 +272,7 @@ static int dpu_encoder_phys_wb_atomic_check( > >> { > >> struct drm_framebuffer *fb; > >> const struct drm_display_mode *mode = &crtc_state->mode; > >> + int ret; > >> > >> DPU_DEBUG("[atomic_check:%d, \"%s\",%d,%d]\n", > >> phys_enc->hw_wb->idx, mode->name, mode->hdisplay, mode->vdisplay); > >> @@ -308,6 +309,12 @@ static int dpu_encoder_phys_wb_atomic_check( > >> return -EINVAL; > >> } > >> > >> + ret = drm_atomic_helper_check_wb_connector_state(conn_state->connector, conn_state->state); > >> + if (ret < 0) { > >> + DPU_ERROR("invalid pixel format %p4cc\n", &fb->format->format); > >> + return ret; > >> + } > > > > There is no guarantee that there will be no other checks added to this > > helper. So, I think this message is incorrect. If you wish, you can > > promote the level of the message in the helper itself. > > On the other hand, we rarely print such messages by default. Most of > > the checks use drm_dbg. > > > > hmm...actually drm_atomic_helper_check_wb_connector_state() already has > a debug message to indicate invalid pixel formats. > > You are right, i should perhaps just say that "atomic_check failed" or > something. > > I can make this a DPU_DEBUG. Actually I didnt know that we are not > supposed to print out atomic_check() errors. Is it perhaps because its > okay for check to fail? There are no messages by default there, because otherwise it is so easy for the user to overspam the dmesg and thus syslog / journal. DoS on the plate. > > But then we would not know why it failed. Think about the user of X11. They don't see the console. And by default in the contemporary distros they won't be able to check dmesg. So if a commit fails, they have to deduce anyway, why did it fail. > > >> + > >> return 0; > >> } > >> > >> -- > >> 2.40.1 > >> > > > >
diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_wb.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_wb.c index bb94909caa25..425415d45ec1 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_wb.c +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_wb.c @@ -272,6 +272,7 @@ static int dpu_encoder_phys_wb_atomic_check( { struct drm_framebuffer *fb; const struct drm_display_mode *mode = &crtc_state->mode; + int ret; DPU_DEBUG("[atomic_check:%d, \"%s\",%d,%d]\n", phys_enc->hw_wb->idx, mode->name, mode->hdisplay, mode->vdisplay); @@ -308,6 +309,12 @@ static int dpu_encoder_phys_wb_atomic_check( return -EINVAL; } + ret = drm_atomic_helper_check_wb_connector_state(conn_state->connector, conn_state->state); + if (ret < 0) { + DPU_ERROR("invalid pixel format %p4cc\n", &fb->format->format); + return ret; + } + return 0; }