Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp2846634rdg; Mon, 16 Oct 2023 17:42:00 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHNYHtdPicTaM/WoIdvlbqGgxN2cRW+hd243E2lSspMdHBfO8mO7XJGwE8aPHQosbhz9tML X-Received: by 2002:a05:6a00:2293:b0:693:43b5:aaf3 with SMTP id f19-20020a056a00229300b0069343b5aaf3mr612120pfe.13.1697503320519; Mon, 16 Oct 2023 17:42:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697503320; cv=none; d=google.com; s=arc-20160816; b=XkOTNuYu7c4dxCJ2A2f8IV6e8GRMl/xm07rbgUaCCkruAFxyupDkmZdgmXhnadXIiQ pXsxJLYFJV6y1NYv2xo24zNSGeHnmcXIKkifq49StYC9g1MeXM9YD9GH0SRFA4ekP2pt JCdYYPwQszvaUQiV9FhgqeuqbAF6VSqDOjutskiLxyIxOJuGq23Ordh/yYCAclxGAhg6 Pnu2k9vlm10S9cVtDNOWvqTFy7s2lOED9Scc6/4E4qCTFWO7nqhjN9f1NJPRo+Uya5Hv Y9z0XFnd3BHl2/1TS0HpxroyYFzH1Nuc+8z9UxF8NK+Zu5bsTUQxRXbPHGBAaPKH37Dn L2qA== 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 :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=3RET9ouFZUaeggz8kqSdC+fqV+R0n5+qMpj00eTouGk=; fh=h25EkSEMLA14gIurOXNTe0FawDMVJzJDFZa6GG4rNtk=; b=YNZmBuxhwnDEFffXmYN8z2RHGnEfiQVHUYQqmiDVWy4fW95OH2T8rlc2TMRMN8o8+O ezjXw91l/+DuMrcMVWL4HbFGY+5iLRXolqEbgQ/ZgOk+l9wF+pp9hMjVEECkf09lb+lC uFWeF4ZC4Yi/xTUISlA9SIRkUZ1pTWFn51lmECKjJZiBdIhr2vjU7zHvhPh9NivOY2Ef 7UAhsNRxauCwX+vyf91hsgPDjUJ+aybEZ0qmlgjwMZ7FzpV5CMZRgh45ajh0JSoGQd1p 8YiZnf9WMUs3HhcjhEQrggBjnytduO1iCyDx5ZRDlK1qA11H2bTIJMKMNUhn11WBdjI+ Vyfw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=Mzi8EbDM; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 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. [23.128.96.33]) by mx.google.com with ESMTPS id z16-20020a656650000000b00578d5a135dasi533499pgv.891.2023.10.16.17.41.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Oct 2023 17:42:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=Mzi8EbDM; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 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 0052A8033352; Mon, 16 Oct 2023 17:41:57 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233835AbjJQAlt (ORCPT + 99 others); Mon, 16 Oct 2023 20:41:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51486 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232873AbjJQAls (ORCPT ); Mon, 16 Oct 2023 20:41:48 -0400 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 79B1092; Mon, 16 Oct 2023 17:41:46 -0700 (PDT) Received: from pps.filterd (m0279865.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 39GNGRQ0025543; Tue, 17 Oct 2023 00:41:08 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=3RET9ouFZUaeggz8kqSdC+fqV+R0n5+qMpj00eTouGk=; b=Mzi8EbDMxdZB4cziLAYPd2P2sk9TUdUjjvY++X6gESyr1KwcGsQoxzGKjaSdxW+UwMnH 2if4/kOnl8sBbK8NMdWQoRiy4DGkvZbz5CaJWvd0M1wPISo8QhIR0qrTC0499YbTAd8l drgKnVvGaM3xFgX+jd0MrKz/AE5TJar2S2+uBStl+Kehrqep79PyVh8Vp3o6A0L7BfTs fHA6KQo5tksQtyF7SfxBy+JgCbjl0jHV2VrDRAG7DubkfifRXlIQao6LMwJdm8/Iz0wS zQsiQUfGkDjv/o2izuJwJ8/6bliFHMP2thUkIJpcC28lzelfeM2c8D6qDeoRLrOEjEgX RQ== Received: from nasanppmta01.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3ts9jnrw6r-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 17 Oct 2023 00:41:08 +0000 Received: from nasanex01b.na.qualcomm.com (nasanex01b.na.qualcomm.com [10.46.141.250]) by NASANPPMTA01.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 39H0f7JM010862 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 17 Oct 2023 00:41:07 GMT Received: from [10.71.110.254] (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.36; Mon, 16 Oct 2023 17:41:07 -0700 Message-ID: <26585954-7c86-45fd-9190-f1109cbe9901@quicinc.com> Date: Mon, 16 Oct 2023 17:40:53 -0700 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [Freedreno] [PATCH RFC v6 07/10] drm/atomic: Loosen FB atomic checks To: Dmitry Baryshkov , Pekka Paalanen CC: , , , Thomas Zimmermann , "Sean Paul" , , Maarten Lankhorst , , "Maxime Ripard" , , Rob Clark , , Daniel Vetter , , Marijn Suijten , , "David Airlie" , References: <20230828-solid-fill-v6-0-a820efcce852@quicinc.com> <20230828-solid-fill-v6-7-a820efcce852@quicinc.com> <20230829112230.7106a8bf@eldfell> <752176d8-23f4-4689-8bf4-db27f153fd39@quicinc.com> <6851b864-447f-453f-8b34-1fbb6e97eefe@linaro.org> Content-Language: en-US From: Jessica Zhang In-Reply-To: <6851b864-447f-453f-8b34-1fbb6e97eefe@linaro.org> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) 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-GUID: QCU-Aw43O5SjvcqtE6It-mLC6vcuM1Uj X-Proofpoint-ORIG-GUID: QCU-Aw43O5SjvcqtE6It-mLC6vcuM1Uj X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.980,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-10-16_13,2023-10-12_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 priorityscore=1501 mlxscore=0 clxscore=1011 phishscore=0 adultscore=0 malwarescore=0 bulkscore=0 suspectscore=0 mlxlogscore=999 spamscore=0 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2309180000 definitions=main-2310170003 X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS 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]); Mon, 16 Oct 2023 17:41:58 -0700 (PDT) On 9/24/2023 3:23 AM, Dmitry Baryshkov wrote: > On 22/09/2023 20:49, Jessica Zhang wrote: >> >> >> On 8/29/2023 1:22 AM, Pekka Paalanen wrote: >>> On Mon, 28 Aug 2023 17:05:13 -0700 >>> Jessica Zhang wrote: >>> >>>> Loosen the requirements for atomic and legacy commit so that, in cases >>>> where pixel_source != FB, the commit can still go through. >>>> >>>> This includes adding framebuffer NULL checks in other areas to >>>> account for >>>> FB being NULL when non-FB pixel sources are enabled. >>>> >>>> To disable a plane, the pixel_source must be NONE or the FB must be >>>> NULL >>>> if pixel_source == FB. >>>> >>>> Signed-off-by: Jessica Zhang >>>> --- >>>>   drivers/gpu/drm/drm_atomic.c        | 20 +++++++++++--------- >>>>   drivers/gpu/drm/drm_atomic_helper.c | 36 >>>> ++++++++++++++++++++---------------- >>>>   include/drm/drm_atomic_helper.h     |  4 ++-- >>>>   include/drm/drm_plane.h             | 29 >>>> +++++++++++++++++++++++++++++ >>>>   4 files changed, 62 insertions(+), 27 deletions(-) >>> >>> ... >>> >>>> diff --git a/include/drm/drm_plane.h b/include/drm/drm_plane.h >>>> index a58f84b6bd5e..4c5b7bcdb25c 100644 >>>> --- a/include/drm/drm_plane.h >>>> +++ b/include/drm/drm_plane.h >>>> @@ -992,6 +992,35 @@ static inline struct drm_plane >>>> *drm_plane_find(struct drm_device *dev, >>>>   #define drm_for_each_plane(plane, dev) \ >>>>       list_for_each_entry(plane, &(dev)->mode_config.plane_list, head) >>>> +/** >>>> + * drm_plane_solid_fill_enabled - Check if solid fill is enabled on >>>> plane >>>> + * @state: plane state >>>> + * >>>> + * Returns: >>>> + * Whether the plane has been assigned a solid_fill_blob >>>> + */ >>>> +static inline bool drm_plane_solid_fill_enabled(struct >>>> drm_plane_state *state) >>>> +{ >>>> +    if (!state) >>>> +        return false; >>>> +    return state->pixel_source == DRM_PLANE_PIXEL_SOURCE_SOLID_FILL >>>> && state->solid_fill_blob; >>>> +} >>>> + >>>> +static inline bool drm_plane_has_visible_data(const struct >>>> drm_plane_state *state) >>>> +{ >>>> +    switch (state->pixel_source) { >>>> +    case DRM_PLANE_PIXEL_SOURCE_NONE: >>>> +        return false; >>>> +    case DRM_PLANE_PIXEL_SOURCE_SOLID_FILL: >>>> +        return state->solid_fill_blob != NULL; >>> >>> This reminds me, new UAPI docs did not say what the requirements are for >>> choosing solid fill pixel source. Is the atomic commit rejected if >>> pixel source is solid fill, but solid_fill property has no blob? >> >> Hi Pekka, >> >> Yes, if pixel_source is solid_fill and the solid_fill property blob >> isn't set, the atomic commit should throw an error. >> >> Will document this in the UAPI. > > I don't see a corresponding error check in atomic_check() functions. > Could you please check that there is one, as you are updating the uAPI. Hi Dmitry, Sorry for the late response. drm_plane_has_visible_data() is being called from drm_atomic_plane_check() which is called from drm_atomic_commit() (via drm_atomic_check_only()). It's also called within the atomic_check() callstack in drm_atomic_helper_check_plane_state(), though that check will set plane.visible to false and return 0. Would it be better to have a more explicit `if (source == solid_fill && !plane->solid_fill_blob) then return -EINVAL` check in atomic_check()? Thanks, Jessica Zhang > >> >> Thanks, >> >> Jessica Zhang >> >>> >>> This should be doc'd. >>> >>> >>> Thanks, >>> pq >>> >>>> +    case DRM_PLANE_PIXEL_SOURCE_FB: >>>> +    default: >>>> +        WARN_ON(state->pixel_source != DRM_PLANE_PIXEL_SOURCE_FB); >>>> +    } >>>> + >>>> +    return state->fb != NULL; >>>> +} >>>> + >>>>   bool drm_any_plane_has_format(struct drm_device *dev, >>>>                     u32 format, u64 modifier); >>>> >>> > > -- > With best wishes > Dmitry >