From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from cstnet.cn (smtp81.cstnet.cn [159.226.251.81]) (using TLSv1.2 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id F295B4418D1 for ; Thu, 26 Feb 2026 16:07:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=159.226.251.81 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772122033; cv=none; b=uj2AbVbnhnU1vRo9HwV+nAZpHmgXGmTnYc5YJDyIMVtqAY0VUs4mk+syo574lV2J0H+BpbG5raQ2BLoXEr3TP/pWYCBs6uJ63eH3CSZT0eGoM4EsiJdsPtmH/jtTbF/KZFhay7NCoeL00I8j1Z8Q6zXG4ZfJg3xPE6f5xvjc0Rg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772122033; c=relaxed/simple; bh=ltkXMQIe9Wyi7+BxEtjeSJdviWPidjl7kdKia0cM2Ss=; h=Message-ID:Subject:From:To:Cc:Date:In-Reply-To:References: Content-Type:MIME-Version; b=TqWnLuV/2f24d5SzSCmAcNF731jnG6TEBMXOKEc97bmpPVSoCQVre7Ux+B5kVHbJ+xHRdAbQcGPjj/bgJAv03Eoi0oXrcZnvZ386QsVLzZ/63SBrfeJR6R2icPInvSy0wcbEJAgIDS32RpS831/rRPusYOHN/JJZ+DGfFyslauk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=iscas.ac.cn; spf=pass smtp.mailfrom=iscas.ac.cn; arc=none smtp.client-ip=159.226.251.81 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=iscas.ac.cn Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=iscas.ac.cn Received: from edelgard.fodlan.icenowy.me (unknown [112.94.101.233]) by APP-03 (Coremail) with SMTP id rQCowACHqN+ib6BpJwheCQ--.4105S2; Fri, 27 Feb 2026 00:06:59 +0800 (CST) Message-ID: <6bfa80c659d0f1336bcddd844874693766791b6e.camel@iscas.ac.cn> Subject: Re: [PATCH 2/2] drm/dumb-buffers: document abuses in the UAPI document From: Icenowy Zheng To: Thomas Zimmermann , Maarten Lankhorst , Maxime Ripard , David Airlie , Simona Vetter Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Date: Fri, 27 Feb 2026 00:06:58 +0800 In-Reply-To: <4380ab4e-6b40-4f72-91f3-2dc0362ce2a5@suse.de> References: <20260226063740.2872016-1-zhengxingda@iscas.ac.cn> <20260226063740.2872016-2-zhengxingda@iscas.ac.cn> <4380ab4e-6b40-4f72-91f3-2dc0362ce2a5@suse.de> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.58.3 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-CM-TRANSID:rQCowACHqN+ib6BpJwheCQ--.4105S2 X-Coremail-Antispam: 1UD129KBjvJXoW7KrW3tw4fJFyrurWfGw4UArb_yoW8ZF1DpF Z3KaykCa1kArZ3AF18Ca1avF15J397WF1rGa4jgw1xWF98tr1Iqr40kr98ZrZrZr4kGw1j qryavry3uasrAF7anT9S1TB71UUUUU7qnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDU0xBIdaVrnRJUUUkYb7Iv0xC_Kw4lb4IE77IF4wAFF20E14v26r4j6ryUM7CY07I2 0VC2zVCF04k26cxKx2IYs7xG6rWj6s0DM7CIcVAFz4kK6r1j6r18M28lY4IEw2IIxxk0rw A2F7IY1VAKz4vEj48ve4kI8wA2z4x0Y4vE2Ix0cI8IcVAFwI0_JFI_Gr1l84ACjcxK6xII jxv20xvEc7CjxVAFwI0_Gr0_Cr1l84ACjcxK6I8E87Iv67AKxVWUJVW8JwA2z4x0Y4vEx4 A2jsIEc7CjxVAFwI0_Jr0_Gr1le2I262IYc4CY6c8Ij28IcVAaY2xG8wAqx4xG64xvF2IE w4CE5I8CrVC2j2WlYx0E2Ix0cI8IcVAFwI0_Jr0_Jr4lYx0Ex4A2jsIE14v26r1j6r4UMc vjeVCFs4IE7xkEbVWUJVW8JwACjcxG0xvEwIxGrwCY1x0262kKe7AKxVWUAVWUtwCF04k2 0xvY0x0EwIxGrwCFx2IqxVCFs4IE7xkEbVWUJVW8JwC20s026c02F40E14v26r1j6r18MI 8I3I0E7480Y4vE14v26r106r1rMI8E67AF67kF1VAFwI0_JF0_Jw1lIxkGc2Ij64vIr41l IxAIcVC0I7IYx2IY67AKxVWUJVWUCwCI42IY6xIIjxv20xvEc7CjxVAFwI0_Jr0_Gr1lIx AIcVCF04k26cxKx2IYs7xG6r1j6r1xMIIF0xvEx4A2jsIE14v26r1j6r4UMIIF0xvEx4A2 jsIEc7CjxVAFwI0_Jr0_GrUvcSsGvfC2KfnxnUUI43ZEXa7IU5k9NDUUUUU== X-CM-SenderInfo: x2kh0wp0lqwv3d6l2u1dvotugofq/ =E5=9C=A8 2026-02-26=E5=9B=9B=E7=9A=84 17:01 +0100=EF=BC=8CThomas Zimmerman= n=E5=86=99=E9=81=93=EF=BC=9A > Hi >=20 > Am 26.02.26 um 07:37 schrieb Icenowy Zheng: > > Although the current DRM_IOCTL_MODE_CREATE_DUMB interface design > > only > > suits linear buffers, some KMS drivers abuse it for AFBC > > framebuffers. > >=20 > > Mention it in the interface document, and clarifying that it's not > > recommended. > >=20 > > Signed-off-by: Icenowy Zheng > > --- > > =C2=A0 include/uapi/drm/drm_mode.h | 4 ++++ > > =C2=A0 1 file changed, 4 insertions(+) > >=20 > > diff --git a/include/uapi/drm/drm_mode.h > > b/include/uapi/drm/drm_mode.h > > index cbbbfc1dfe2b8..02b6fa7ade355 100644 > > --- a/include/uapi/drm/drm_mode.h > > +++ b/include/uapi/drm/drm_mode.h > > @@ -1256,6 +1256,10 @@ struct drm_mode_crtc_page_flip_target { >=20 > Since you're at it, you should move the line at [1] right here as the > first sentence of this paragraph. Then continue with 'Do not > attempt'. >=20 > With that change, the previous paragraphs refer to pixel formats and > the=20 > final one refers to framebuffer layout. >=20 >=20 > > =C2=A0=C2=A0 * Do not attempt to allocate anything but linear framebuff= er > > memory > > =C2=A0=C2=A0 * with single-plane RGB data. Allocation of other framebuf= fer > > =C2=A0=C2=A0 * layouts requires dedicated ioctls in the respective DRM > > driver. > > + * There exists drivers exploiting this interface for framebuffers >=20 > 'exists user-space software' Ah the drivers seem to be also criminal to accept this kind of usage, it's why I thought about writing "drivers" here. Thanks Icenowy >=20 > > + * with modifiers other than DRM_FORMAT_MOD_LINEAR, but this is >=20 > Rather 'with non-linear layout'.=C2=A0 The reference to MOD_LINEAR seems > out=20 > of place here. >=20 > > + * incorrect usage with undefined behavior, and should not be > > + * replicated. >=20 > Best regards > Thomas >=20 > [1]=20 > https://elixir.bootlin.com/linux/v6.19/source/include/uapi/drm/drm_mode.h= #L1216 >=20 > > =C2=A0=C2=A0 */ > > =C2=A0 struct drm_mode_create_dumb { > > =C2=A0=C2=A0 __u32 height;