From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D6AAC3FBEC2 for ; Tue, 25 Aug 2026 15:10:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.168.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787670624; cv=none; b=MYfzUzR2J2qOENPrOlfIIi+hgGvLmg5YFO8DHd90beiqT5fSy7aG1hfGTS/LSvY1Eh4lXuFtjdgqb2fd/0ZJ/oHC3TcLNpc3km+4Udt4A262GJx6+zTGQcupSQ0vSy2RwOs2c4ypNLlQct2EbY9y8KmrJTO5maPiwv5MJVuW/qc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787670624; c=relaxed/simple; bh=31rNBGesDBZX+Xtthz+D0TJ2t/NrJy1H92YezKiuGcs=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=bnSOx3qFmQQIr2QNOVB2Uo3aIcBZUZ1v72YI8cv1qCQa59hN7XT2zt64RQrFRiJNVhpbN9IZ8cIdE/9+W94veB67irCWRNRqWRPnD3k4RwhE1+MtnEA+Vmi5KOJvcF1eqydBACafpz5rcQrYTuCvJ1MEm1Ns9oSjuGxaNAmQ4U8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=jkrB5NDN; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=BmOayQUd; arc=none smtp.client-ip=205.220.168.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="jkrB5NDN"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="BmOayQUd" Received: from pps.filterd (m0279867.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 67PEU37V3248678 for ; Tue, 25 Aug 2026 15:10:22 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= x0A9btRvyQfNGEMbRXj1NIxUjbY9mjUOkIxhGDJcN9c=; b=jkrB5NDNepVjLYDj eZeRB8LkZxGejvAJe4aqukp3qAgik1G7tK3pZCaYJIBoP9TI5iirYJGJce4+O/92 FVDnX7WS8XThY20+BsebBDH1Gxv+yNjcrfZny2PkhrmmuPrciEVVSWpYaIohFY54 JfnYnDdrsY37MePXeXbQMT+0lDAcqyhJA0VuwEA2hFF69Ozr3ePpgvPbn0+f7T+p YyTpBU3cvU9NPUVLpqxjHUg0akgpydNF43QUSSAjnldeZ734llwFi2A8/D9MloH/ uP48yOqvJ9ZoMOx+0RAs+V0pky/sjHvhIOqDriZzaXAaqCgi25qLwpcoBPgUHwyc AudaDQ== Received: from mail-pj1-f71.google.com (mail-pj1-f71.google.com [209.85.216.71]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4g9bnj8kw8-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Tue, 25 Aug 2026 15:10:22 +0000 (GMT) Received: by mail-pj1-f71.google.com with SMTP id 98e67ed59e1d1-38dbf293831so2839349a91.3 for ; Tue, 25 Aug 2026 08:10:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1787670621; x=1788275421; darn=vger.kernel.org; h=content-transfer-encoding:content-type:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:from:to:cc:subject:date:message-id:reply-to :content-type; bh=x0A9btRvyQfNGEMbRXj1NIxUjbY9mjUOkIxhGDJcN9c=; b=BmOayQUdUq0ZAaX0NJImZaC9NMgotFEW8Ka7u4F8ZDXt2QKSw03gOVivteb1ziYC7T uSDxr4Mx/lHaLlUmAYlq0xpiCpxHgDqJ3pwRpGLbSlV+WFHsjP2+7KMHkOxp9l/cSRyZ 6mzrS7eAdX68xsdr0rH+I3ropFY9e/HyRnF/Th3osUayCjl62B+PsdYnAuSmp2H1pSku hRj1L1OOLIFG3LR8u5Qigjr15Cv+QsUY5JPD3pdMac3NB4/XELdbzYb8EvvuwyWqH63a OJOazhB5wT/pWjC+nui0Z1C1aRHUbqAcn3X3WB3TWvShqknVI310gKY8SrZHthqbrG6V 6M5w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1787670621; x=1788275421; h=content-transfer-encoding:content-type:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=x0A9btRvyQfNGEMbRXj1NIxUjbY9mjUOkIxhGDJcN9c=; b=PvJ33pVg1mCazmBY/6T4AzN2LLZagXJ92f6jYEI4tvSy2oAgWvqt2elbSOTMVfVNLB uQhXQYXemrvbf4dPJ9WfvwTHrHJRXv5C6GdT8ej6BPgi1EGwiqqXTD3/NRD1OvmPLGtB 4E9mRjXopdBFQpKb818Lqiyx44rDeXrxA3vlz70DHPp3RE43k5KFgT+4Lw0D1rgvPF/4 Ws4VKE+kCmV556OCUsI0Sf6g+sgBQuNcD7IOvSJ0rNXKoMPK360mx4Z6Vdrjz8/yv7+H O+smGJdT+43qXprbK3bqxu/XkHJZc/bBNbOkKmInXkK1Ghf6nc8qtYc7DQZlqBqXd9IZ tOWA== X-Forwarded-Encrypted: i=1; AHgh+Rrw8z2c/wTLQJUSG5Oc/Ezh6mDiFLuIjEnWYUcjGWqpIbODoF5OIXH89cVi2hvgaQJOV+R9Vf0Hmc7cnyc=@vger.kernel.org X-Gm-Message-State: AFuF++mK+jdcaT9gAw2gJhZkPqxMtfOJqisv46dYPu0AzO8wqJgra0sJ y8RxtYDhyumCxp3qK+9pvthudCd7drcRJMVjJeTDljg1Ln++RjO+5rrIOaIZ7d61J0P8K128j79 HW41j7YbPdzBDgD4SiLyxTvPcWqznAwUndKN7dkzV1K2Pr93qOy1LDJFFh8fPwmlg7sM= X-Gm-Gg: AR+sD13d38G2PuNZTtgQcyBE2YawxiDBKStiGb8wwpgkIwcFUcPeSUiqyyBH1e8BnpU kao+I+W6wwuS7zA/sn0D0Ga0Yr5lu0Qu5eXsIPvPlC6p/C3YUkL9EYDw/Br/ncbXnMTrMzdaO0f lMNuDIMYdIX7M+KLCKVyINqtgb9p9RIkeXyw8rQm5N/2GaU2nS+U/tNoyxB6AlInb1dxuDTLeNw 0EA88LoyckMokGKf44k3YKG13NEN6y/61jmBCbTMgxmC1zTPjfRZj11WgAMNA4sApyRPi3oH0Nh XTufAaoWDxbh22PXR3MEmgQm+3p3XU0nASJ6eNiFHJxlQiKmoP7tiB+nIoszjhQhI6dEC8eAeUx fqtNQ3/1XGSz5dqA5KRPJ3rLiIjs= X-Received: by 2002:a17:90b:56c8:b0:38a:c3f:3b87 with SMTP id 98e67ed59e1d1-3964652108bmr15862963a91.12.1787670621396; Tue, 25 Aug 2026 08:10:21 -0700 (PDT) X-Received: by 2002:a17:90b:56c8:b0:38a:c3f:3b87 with SMTP id 98e67ed59e1d1-3964652108bmr15862841a91.12.1787670620891; Tue, 25 Aug 2026 08:10:20 -0700 (PDT) Received: from [10.204.78.62] ([202.46.23.25]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-3965d119724sm1927178a91.2.2026.08.25.08.10.15 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 25 Aug 2026 08:10:20 -0700 (PDT) Message-ID: Date: Tue, 25 Aug 2026 20:40:14 +0530 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] drm/msm/dpu: advertise linear-only modifiers on platforms without UBWC To: Nabige Aala , Rob Clark , Dmitry Baryshkov , Abhinav Kumar , Jessica Zhang , Sean Paul , Marijn Suijten , David Airlie , Simona Vetter Cc: linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org, linux-kernel@vger.kernel.org References: <20260819-remove_ubwc-v1-1-5357d5cc517f@oss.qualcomm.com> <672f91dd-749a-4448-ab32-50ac064a4b98@oss.qualcomm.com> Content-Language: en-US From: Mahadevan P In-Reply-To: <672f91dd-749a-4448-ab32-50ac064a4b98@oss.qualcomm.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Proofpoint-GUID: HdsVtkTqPh-ZPvUIJHqU2cVB5MeD92Kb X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwODI1MDEyOCBTYWx0ZWRfX5VgcoAggGlFN ZTyPCI8aRhGrCs2KnpruHXED0g98JuQ3EYsPUUcFYvTZ1CMN4lMHxDtHbWGSSAXNnIp2vpxmDid RRmp3D70MMIp9mpWsANsSPoku/Iflo9dzNuAiP+L1bDF+bNQUGN3LWvCBBT/mZglOjfy4a29kba QrGG+kYg6lGlFg0+rdEa4fFWZbpHAAR9zU10P0sinXPp+/XdPqdVUc9JGKRTR2SghWSSdWyKYDH QW7eRfh17mydjY5fEICnX/6rOHKkdRwsii6wvGK9hcF6Fu3J3CPM+zUYq80dYJ3jd0UajX1sFQv 4Src7aq0/m34Ne8gBSeRjYg/4J75AXWFglr1yt0+QxA7yQ7hqKcEQYrh+opcYrC0vgQySkXc1rM kEhtWjyHHVHrMATrBRuXQou5I3IQATyqfbg8seYw4yDjsSEoYvF0upVb2rYG84Gpn28/cs4WuQP avjefQVtKgf9wXMcTbg== X-Authority-Analysis: v=2.4 cv=ZuHd7d7G c=1 sm=1 tr=0 ts=6a8db05e cx=c_pps a=UNFcQwm+pnOIJct1K4W+Mw==:117 a=ZePRamnt/+rB5gQjfz0u9A==:17 a=IkcTkHD0fZMA:10 a=Sv0fKeRqtYgA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=eoimf2acIAo5FJnRuUoq:22 a=EUspDBNiAAAA:8 a=INP11UExdj8QQtfJzOMA:9 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10 a=uKXjsCUrEbL0IQVhDsJ9:22 X-Proofpoint-Spam-Info: AW1haW4tMjYwODI1MDEyOCBTYWx0ZWRfXzCCEeEPbdoUU /GII0DxeCRfVQuqoz/WdioNEpX/N81ZXylL1JqGp+1MKmBUogFeqnhgerhobsuY0XaSlm+Qg1dk J9U6JGrbx/+aV3y0ruXG7YYmXnH4aI0= X-Proofpoint-ORIG-GUID: HdsVtkTqPh-ZPvUIJHqU2cVB5MeD92Kb X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-08-25_04,2026-08-24_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 lowpriorityscore=0 spamscore=0 priorityscore=1501 adultscore=0 suspectscore=0 impostorscore=0 malwarescore=0 clxscore=1015 bulkscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2608250128 On 8/24/2026 1:01 PM, Nabige Aala wrote: > > On 8/19/2026 4:53 PM, Mahadevan P wrote: >> Certain Qualcomm targets like QCM2290 and Shikra do not have UBWC >> support. On such targets, advertising DRM_FORMAT_MOD_QCOM_COMPRESSED >> in the supported modifier list causes userspace to attempt UBWC >> allocations that the kernel rejects: >> >>    msm_dpu: [drm] *ERROR* unsupported format modifier 500000000000003 >>    msm_dpu: [drm] *ERROR* unsupported pixel format: AR24 little-endian >> >> On platforms without UBWC, only advertise DRM_FORMAT_MOD_LINEAR to >> avoid exposing formats that the hardware cannot handle. >> >> Fixes: 71c5c23be874 ("drm/msm/dpu: check ubwc support before adding >> compressed formats") >> Signed-off-by: Mahadevan P >> --- >>   drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c | 10 +++++++++- >>   1 file changed, 9 insertions(+), 1 deletion(-) >> >> diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c b/drivers/gpu/ >> drm/msm/disp/dpu1/dpu_plane.c >> index 7b92082d35a6..c8bd034690cb 100644 >> --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c >> +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c >> @@ -94,6 +94,11 @@ static const uint64_t supported_format_modifiers[] = { >>       DRM_FORMAT_MOD_INVALID >>   }; >> +static const uint64_t supported_format_modifiers_no_ubwc[] = { >> +    DRM_FORMAT_MOD_LINEAR, >> +    DRM_FORMAT_MOD_INVALID >> +}; >> + >>   #define to_dpu_plane(x) container_of(x, struct dpu_plane, base) >>   static struct dpu_kms *_dpu_plane_get_kms(struct drm_plane *plane) >> @@ -1836,7 +1841,10 @@ static struct drm_plane >> *dpu_plane_init_common(struct drm_device *dev, >>       pdpu = drmm_universal_plane_alloc(dev, struct dpu_plane, base, >>                   0xff, &dpu_plane_funcs, >>                   format_list, num_formats, >> -                supported_format_modifiers, type, NULL); >> +                (kms->mdss->ubwc_enc_version == 0) ? >> +                    supported_format_modifiers_no_ubwc : >> +                    supported_format_modifiers, > > Can we just pass the NULL here in case no ubwc modifer are supported > instead of "supported_format_modifier_no_ubwc"? > > would not it automatically handled in this function > __drm_universal_plane_init as default_modifier? Thanks for the review. Please drop this patch - it is not needed. The commit message was wrong. The modifier in the log I quoted, 0x500000000000003, is DRM_FORMAT_MOD_QCOM_TILED3, not DRM_FORMAT_MOD_QCOM_COMPRESSED (0x500000000000001). DPU does not advertise TILED3 anywhere, so this patch could neither have caused nor fixed that error. I pasted that log here by mistake; it came from an unrelated experiment. Having re-checked the current code, there is nothing left to fix: - 71c5c23be874 already makes dpu_plane_format_mod_supported() return false for QCOM_COMPRESSED when ubwc_enc_version == 0, and drm_plane_has_format() consults that callback in preference to plane->modifiers[]. UBWC commits are therefore already rejected on QCM2290 and Shikra. - create_in_format_blob() runs the same callback for every (format, modifier) pair, so the QCOM_COMPRESSED entry in IN_FORMATS already carries an all-zero format bitmask. So the patch's only observable effect was to stop a zero-format modifier entry from being enumerated in the IN_FORMATS blob. That is cosmetic, and certainly not a Fixes: for 71c5c23be874. To answer your question: you were right, NULL is equivalent. __drm_universal_plane_init() substitutes { DRM_FORMAT_MOD_LINEAR } when format_modifiers is NULL, and this is documented in the drm_universal_plane_init() kernel-doc. Please mark this as Not Applicable. Sorry for the noise. > > Thanks, > > Nabige > >> +                type, NULL); >>       if (IS_ERR(pdpu)) >>           return ERR_CAST(pdpu); >> >> --- >> base-commit: e6664f2b33db9b6811eb4cec109f06cb2b4f458d >> change-id: 20260819-remove_ubwc-0180dfb2908c >> >> Best regards, Thanks, Mahadevan