From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.223.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4DFA4222590 for ; Thu, 16 Jul 2026 06:59:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.135.223.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784185184; cv=none; b=hOSYnztw7h8WJQn3b0VmJZnNRArVxMIJAVA0NEkpHT7TgitlT5FMUavtR/J+OhFa6inbZ7mNLJ1l9M0TSCCJj2t+PzQj9R8QAcyDeLigTC/T1MXSSDLl+i0qL8L4iIFzTeE0bNLlEYgidE85qhUbsYqnxAlzKJxp4iDFidMIdtM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784185184; c=relaxed/simple; bh=nvx7WgbZP1pTovlku+EoIHuodcsWWJenef6mKYSl4H4=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=BZE/hdtZ5O3gRf2pn8uTB0yCvxrZBJQXO2U83qtoaXfVaJ8ByFKxZmhx4rcSCv4MO4rA+gB8YChW3R/zYyzyhcXReIkoFSj51bZd3/zJe9JNqzhJoNx/sD6cgKG0JbvbxEOXJFvPxUn4lukREpHY62AdFr3rwq+FK4RpUEtBoho= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de; spf=pass smtp.mailfrom=suse.de; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=cIYSrIbC; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=RotCm/dR; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=cIYSrIbC; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=RotCm/dR; arc=none smtp.client-ip=195.135.223.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="cIYSrIbC"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="RotCm/dR"; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="cIYSrIbC"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="RotCm/dR" Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 4CD6C3E2F; Thu, 16 Jul 2026 06:59:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1784185180; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:autocrypt:autocrypt; bh=Q1Sttv12LM5ZFZtfZAvp/tl8h/l27/XJeBYQK86qDiI=; b=cIYSrIbCUduGY3EjUg90J9G3UC0BYUuCjzVkIcfrWU8iZlvcW5Iu9UHdFKr+KaXkJ4f0bs MPfPPpnxDBbWBa1rK9L7VvZ3byu+G/efByfjorVk/sAV2DEyIG3sXQsmLs/nqwcmVRPzWw Ku64UflloBaoMkE5pPc/RBAZrSJyrXo= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1784185180; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:autocrypt:autocrypt; bh=Q1Sttv12LM5ZFZtfZAvp/tl8h/l27/XJeBYQK86qDiI=; b=RotCm/dRVAuJZXZ1+5A3Y0v0/p/apXcKPfJJfvZwH/7OyTAKd2wgM4iWSbFnB0QXKtEgVD wKK1oZYEzEcrBXBw== Authentication-Results: smtp-out2.suse.de; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=cIYSrIbC; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b="RotCm/dR" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1784185180; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:autocrypt:autocrypt; bh=Q1Sttv12LM5ZFZtfZAvp/tl8h/l27/XJeBYQK86qDiI=; b=cIYSrIbCUduGY3EjUg90J9G3UC0BYUuCjzVkIcfrWU8iZlvcW5Iu9UHdFKr+KaXkJ4f0bs MPfPPpnxDBbWBa1rK9L7VvZ3byu+G/efByfjorVk/sAV2DEyIG3sXQsmLs/nqwcmVRPzWw Ku64UflloBaoMkE5pPc/RBAZrSJyrXo= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1784185180; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:autocrypt:autocrypt; bh=Q1Sttv12LM5ZFZtfZAvp/tl8h/l27/XJeBYQK86qDiI=; b=RotCm/dRVAuJZXZ1+5A3Y0v0/p/apXcKPfJJfvZwH/7OyTAKd2wgM4iWSbFnB0QXKtEgVD wKK1oZYEzEcrBXBw== Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 1569C779AD; Thu, 16 Jul 2026 06:59:40 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id uuLAA1yBWGoRfQAAD6G6ig (envelope-from ); Thu, 16 Jul 2026 06:59:40 +0000 Message-ID: Date: Thu, 16 Jul 2026 08:59:39 +0200 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: make panel orientation quirks optional To: Andrew Zhou , dri-devel@lists.freedesktop.org Cc: maarten.lankhorst@linux.intel.com, mripard@kernel.org, airlied@gmail.com, simona@ffwll.ch, linux-kernel@vger.kernel.org References: <20260716065106.150760-1-zhoulol888@gmail.com> Content-Language: en-US From: Thomas Zimmermann Autocrypt: addr=tzimmermann@suse.de; keydata= xsBNBFs50uABCADEHPidWt974CaxBVbrIBwqcq/WURinJ3+2WlIrKWspiP83vfZKaXhFYsdg XH47fDVbPPj+d6tQrw5lPQCyqjwrCPYnq3WlIBnGPJ4/jreTL6V+qfKRDlGLWFjZcsrPJGE0 BeB5BbqP5erN1qylK9i3gPoQjXGhpBpQYwRrEyQyjuvk+Ev0K1Jc5tVDeJAuau3TGNgah4Yc hdHm3bkPjz9EErV85RwvImQ1dptvx6s7xzwXTgGAsaYZsL8WCwDaTuqFa1d1jjlaxg6+tZsB 9GluwvIhSezPgnEmimZDkGnZRRSFiGP8yjqTjjWuf0bSj5rUnTGiyLyRZRNGcXmu6hjlABEB AAHNJ1Rob21hcyBaaW1tZXJtYW5uIDx0emltbWVybWFubkBzdXNlLmRlPsLAjgQTAQgAOAIb AwULCQgHAgYVCgkICwIEFgIDAQIeAQIXgBYhBHIX+6yM6c9jRKFo5WgNwR1TC3ojBQJftODH AAoJEGgNw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 4kyYYMhuULvrJDMjZRvaNe52tkKAvMevcGdt38H4KSVXAylqyQOW5zvPc4/sq9c= In-Reply-To: <20260716065106.150760-1-zhoulol888@gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Flag: NO X-Rspamd-Action: no action X-Spam-Level: X-Spamd-Result: default: False [-4.51 / 50.00]; BAYES_HAM(-3.00)[100.00%]; NEURAL_HAM_LONG(-1.00)[-1.000]; R_DKIM_ALLOW(-0.20)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; NEURAL_HAM_SHORT(-0.20)[-1.000]; MIME_GOOD(-0.10)[text/plain]; MX_GOOD(-0.01)[]; FREEMAIL_ENVRCPT(0.00)[gmail.com]; FUZZY_RATELIMITED(0.00)[rspamd.com]; ARC_NA(0.00)[]; TO_DN_SOME(0.00)[]; RCVD_TLS_ALL(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_VIA_SMTP_AUTH(0.00)[]; FREEMAIL_TO(0.00)[gmail.com,lists.freedesktop.org]; MID_RHS_MATCH_FROM(0.00)[]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; FROM_HAS_DN(0.00)[]; FREEMAIL_CC(0.00)[linux.intel.com,kernel.org,gmail.com,ffwll.ch,vger.kernel.org]; RCPT_COUNT_SEVEN(0.00)[7]; FROM_EQ_ENVFROM(0.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.de:mid,suse.de:dkim,suse.com:url]; RCVD_COUNT_TWO(0.00)[2]; TO_MATCH_ENVRCPT_ALL(0.00)[]; DKIM_TRACE(0.00)[suse.de:+] X-Rspamd-Server: rspamd2.dmz-prg2.suse.org X-Rspamd-Queue-Id: 4CD6C3E2F X-Spam-Score: -4.51 Hi Am 16.07.26 um 08:51 schrieb Andrew Zhou: > DRM currently selects DRM_PANEL_ORIENTATION_QUIRKS unconditionally, > forcing all DRM users to compile embedded LCD panel quirk detection. > This is unnecessary on desktop and server systems with external > monitors. > > Add a static inline stub in drm_utils.h that returns > DRM_MODE_PANEL_ORIENTATION_UNKNOWN when the option is disabled, > and make the Kconfig option user-visible with a description. > > Compile-tested with CONFIG_DRM_PANEL_ORIENTATION_QUIRKS=y and =n. > Boot-tested in QEMU with TinyCorePure64. NAK. We also need these quirks on desktops, and disabling error workarounds makes little sense IMHO. Best regards Thomas > > Signed-off-by: Andrew Zhou > --- > drivers/gpu/drm/Kconfig | 14 ++++++++++++-- > drivers/gpu/drm/drm_panel_orientation_quirks.c | 6 ++++-- > include/drm/drm_utils.h | 8 ++++++++ > 3 files changed, 24 insertions(+), 4 deletions(-) > > diff --git a/drivers/gpu/drm/Kconfig b/drivers/gpu/drm/Kconfig > index 323422861e8f..da4ac94bbf61 100644 > --- a/drivers/gpu/drm/Kconfig > +++ b/drivers/gpu/drm/Kconfig > @@ -8,7 +8,6 @@ > menuconfig DRM > tristate "Direct Rendering Manager (XFree86 4.1.0 and higher DRI support)" > depends on (AGP || AGP=n) && !EMULATED_CMPXCHG && HAS_DMA > - select DRM_PANEL_ORIENTATION_QUIRKS > select HDMI > select I2C > select DMA_SHARED_BUFFER > @@ -369,4 +368,15 @@ endif > > # Separate option because drm_panel_orientation_quirks.c is shared with fbdev > config DRM_PANEL_ORIENTATION_QUIRKS > - tristate > + tristate "Panel orientation quirks for DMI-based detection" > + depends on DRM > + help > + Enable DMI-based quirk detection for devices where the > + built-in LCD panel is mounted in a non-standard orientation > + relative to the casing (e.g., handheld PCs, tablets). > + > + This allows userspace to automatically rotate the display > + to match the physical orientation of the device. > + > + Desktop and server systems with external monitors do not > + need this. If unsure, say N. > diff --git a/drivers/gpu/drm/drm_panel_orientation_quirks.c b/drivers/gpu/drm/drm_panel_orientation_quirks.c > index 3a218fb592ce..fb09078a831a 100644 > --- a/drivers/gpu/drm/drm_panel_orientation_quirks.c > +++ b/drivers/gpu/drm/drm_panel_orientation_quirks.c > @@ -14,7 +14,7 @@ > #include > #include > > -#ifdef CONFIG_DMI > +#if defined(CONFIG_DMI) && defined(CONFIG_DRM_PANEL_ORIENTATION_QUIRKS) > > /* > * Some x86 clamshell design devices use portrait tablet screens and a display > @@ -589,7 +589,7 @@ EXPORT_SYMBOL(drm_get_panel_orientation_quirk); > > #else > > -/* There are no quirks for non x86 devices yet */ > +/* Fallback stub when DMI or the entire quirk module is disabled. */ > int drm_get_panel_orientation_quirk(int width, int height) > { > return DRM_MODE_PANEL_ORIENTATION_UNKNOWN; > @@ -598,5 +598,7 @@ EXPORT_SYMBOL(drm_get_panel_orientation_quirk); > > #endif > > +#ifdef CONFIG_DRM_PANEL_ORIENTATION_QUIRKS > MODULE_DESCRIPTION("Quirks for non-normal panel orientation"); > MODULE_LICENSE("Dual MIT/GPL"); > +#endif > diff --git a/include/drm/drm_utils.h b/include/drm/drm_utils.h > index 6a46f755daba..947b8e71260e 100644 > --- a/include/drm/drm_utils.h > +++ b/include/drm/drm_utils.h > @@ -11,10 +11,18 @@ > #define __DRM_UTILS_H__ > > #include > +#include > > struct drm_edid; > > +#ifdef CONFIG_DRM_PANEL_ORIENTATION_QUIRKS > int drm_get_panel_orientation_quirk(int width, int height); > +#else > +static inline int drm_get_panel_orientation_quirk(int width, int height) > +{ > + return DRM_MODE_PANEL_ORIENTATION_UNKNOWN; > +} > +#endif > > struct drm_panel_backlight_quirk { > u16 min_brightness; -- -- Thomas Zimmermann Graphics Driver Developer SUSE Software Solutions Germany GmbH Frankenstr. 146, 90461 Nürnberg, Germany, www.suse.com GF: Jochen Jaser, Andrew McDonald, (HRB 36809, AG Nürnberg)