Nouveau Archive mirror
 help / color / mirror / Atom feed
* [Nouveau] [PATCH] drm/nouveau/disp: Revert a NULL check inside nouveau_connector_get_modes
@ 2023-08-05 10:18 Karol Herbst
  2023-08-07 20:32 ` Lyude Paul
  0 siblings, 1 reply; 2+ messages in thread
From: Karol Herbst @ 2023-08-05 10:18 UTC (permalink / raw
  To: linux-kernel; +Cc: Olaf Skibbe, nouveau, dri-devel, Ben Skeggs

The original commit adding that check tried to protect the kenrel against
a potential invalid NULL pointer access.

However we call nouveau_connector_detect_depth once without a native_mode
set on purpose for non LVDS connectors and this broke DP support in a few
cases.

Cc: Olaf Skibbe <news@kravcenko.com>
Cc: Lyude Paul <lyude@redhat.com>
Closes: https://gitlab.freedesktop.org/drm/nouveau/-/issues/238
Closes: https://gitlab.freedesktop.org/drm/nouveau/-/issues/245
Fixes: 20a2ce87fbaf8 ("drm/nouveau/dp: check for NULL nv_connector->native_mode")
Signed-off-by: Karol Herbst <kherbst@redhat.com>
---
 drivers/gpu/drm/nouveau/nouveau_connector.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/nouveau/nouveau_connector.c b/drivers/gpu/drm/nouveau/nouveau_connector.c
index f75c6f09dd2af..a2e0033e8a260 100644
--- a/drivers/gpu/drm/nouveau/nouveau_connector.c
+++ b/drivers/gpu/drm/nouveau/nouveau_connector.c
@@ -967,7 +967,7 @@ nouveau_connector_get_modes(struct drm_connector *connector)
 	/* Determine display colour depth for everything except LVDS now,
 	 * DP requires this before mode_valid() is called.
 	 */
-	if (connector->connector_type != DRM_MODE_CONNECTOR_LVDS && nv_connector->native_mode)
+	if (connector->connector_type != DRM_MODE_CONNECTOR_LVDS)
 		nouveau_connector_detect_depth(connector);
 
 	/* Find the native mode if this is a digital panel, if we didn't
-- 
2.41.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [Nouveau] [PATCH] drm/nouveau/disp: Revert a NULL check inside nouveau_connector_get_modes
  2023-08-05 10:18 [Nouveau] [PATCH] drm/nouveau/disp: Revert a NULL check inside nouveau_connector_get_modes Karol Herbst
@ 2023-08-07 20:32 ` Lyude Paul
  0 siblings, 0 replies; 2+ messages in thread
From: Lyude Paul @ 2023-08-07 20:32 UTC (permalink / raw
  To: Karol Herbst, linux-kernel; +Cc: Olaf Skibbe, nouveau, Ben Skeggs, dri-devel

Ugh, thanks for catching this!

Reviewed-by: Lyude Paul <lyude@redhat.com>

On Sat, 2023-08-05 at 12:18 +0200, Karol Herbst wrote:
> The original commit adding that check tried to protect the kenrel against
> a potential invalid NULL pointer access.
> 
> However we call nouveau_connector_detect_depth once without a native_mode
> set on purpose for non LVDS connectors and this broke DP support in a few
> cases.
> 
> Cc: Olaf Skibbe <news@kravcenko.com>
> Cc: Lyude Paul <lyude@redhat.com>
> Closes: https://gitlab.freedesktop.org/drm/nouveau/-/issues/238
> Closes: https://gitlab.freedesktop.org/drm/nouveau/-/issues/245
> Fixes: 20a2ce87fbaf8 ("drm/nouveau/dp: check for NULL nv_connector->native_mode")
> Signed-off-by: Karol Herbst <kherbst@redhat.com>
> ---
>  drivers/gpu/drm/nouveau/nouveau_connector.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/nouveau/nouveau_connector.c b/drivers/gpu/drm/nouveau/nouveau_connector.c
> index f75c6f09dd2af..a2e0033e8a260 100644
> --- a/drivers/gpu/drm/nouveau/nouveau_connector.c
> +++ b/drivers/gpu/drm/nouveau/nouveau_connector.c
> @@ -967,7 +967,7 @@ nouveau_connector_get_modes(struct drm_connector *connector)
>  	/* Determine display colour depth for everything except LVDS now,
>  	 * DP requires this before mode_valid() is called.
>  	 */
> -	if (connector->connector_type != DRM_MODE_CONNECTOR_LVDS && nv_connector->native_mode)
> +	if (connector->connector_type != DRM_MODE_CONNECTOR_LVDS)
>  		nouveau_connector_detect_depth(connector);
>  
>  	/* Find the native mode if this is a digital panel, if we didn't

-- 
Cheers,
 Lyude Paul (she/her)
 Software Engineer at Red Hat


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-08-07 20:33 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-08-05 10:18 [Nouveau] [PATCH] drm/nouveau/disp: Revert a NULL check inside nouveau_connector_get_modes Karol Herbst
2023-08-07 20:32 ` Lyude Paul

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).