mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Ben Skeggs <skeggsb@gmail.com>
To: dri-devel@lists.freedesktop.org
Cc: airlied@redhat.com, linux-kernel@vger.kernel.org,
	Ben Skeggs <bskeggs@redhat.com>
Subject: [PATCH] drm/nouveau: fix panels using straps-based mode detection
Date: Thu, 23 Sep 2010 16:44:01 +1000	[thread overview]
Message-ID: <1285224241-32683-1-git-send-email-skeggsb@gmail.com> (raw)
In-Reply-To: <20100922225612.826b0553.akpm@linux-foundation.org>

From: Ben Skeggs <bskeggs@redhat.com>

nouveau_bios_fp_mode() zeroes the mode struct before filling in relevant
entries.  This nukes the mode id initialised by drm_mode_create(), and
causes warnings from idr when we try to remove the mode.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
---
 drivers/gpu/drm/nouveau/nouveau_connector.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/nouveau/nouveau_connector.c b/drivers/gpu/drm/nouveau/nouveau_connector.c
index 98c214c..4b286a8 100644
--- a/drivers/gpu/drm/nouveau/nouveau_connector.c
+++ b/drivers/gpu/drm/nouveau/nouveau_connector.c
@@ -594,8 +594,10 @@ nouveau_connector_get_modes(struct drm_connector *connector)
 	if (nv_encoder->dcb->type == OUTPUT_LVDS &&
 	    (nv_encoder->dcb->lvdsconf.use_straps_for_mode ||
 	     dev_priv->vbios.fp_no_ddc) && nouveau_bios_fp_mode(dev, NULL)) {
-		nv_connector->native_mode = drm_mode_create(dev);
-		nouveau_bios_fp_mode(dev, nv_connector->native_mode);
+		struct drm_display_mode mode;
+
+		nouveau_bios_fp_mode(dev, &mode);
+		nv_connector->native_mode = drm_mode_duplicate(dev, &mode);
 	}
 
 	/* Find the native mode if this is a digital panel, if we didn't
-- 
1.7.2.2


  parent reply	other threads:[~2010-09-23  6:44 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-22 21:10 idr_remove called for id=0 which is not allocated Alessandro Guido
2010-09-22 21:17 ` Alessandro Guido
2010-09-23  5:56 ` Andrew Morton
2010-09-23  6:33   ` Ben Skeggs
2010-09-23  6:44   ` Ben Skeggs [this message]
2010-09-23  9:13     ` [PATCH] drm/nouveau: fix panels using straps-based mode detection Alessandro Guido
2010-09-23 18:56     ` Phil Turmel
2010-09-23  9:24   ` idr_remove called for id=0 which is not allocated Alessandro Guido

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1285224241-32683-1-git-send-email-skeggsb@gmail.com \
    --to=skeggsb@gmail.com \
    --cc=airlied@redhat.com \
    --cc=bskeggs@redhat.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®