Francisco Jerez
2009-Oct-05 02:37 UTC
[Nouveau] [PATCH 1/3] drm/nouveau: Ignore DCB I2C indices for on-chip TV-out.
The nv31m in bug 23212 claims its TV-out and LVDS are in the same
connector. Ignore it completely as it's otherwise useless.
Signed-off-by: Francisco Jerez <currojerez at riseup.net>
---
drivers/gpu/drm/nouveau/nouveau_bios.c | 11 +++++++++++
1 files changed, 11 insertions(+), 0 deletions(-)
diff --git a/drivers/gpu/drm/nouveau/nouveau_bios.c
b/drivers/gpu/drm/nouveau/nouveau_bios.c
index 195ecb3..01ef97e 100644
--- a/drivers/gpu/drm/nouveau/nouveau_bios.c
+++ b/drivers/gpu/drm/nouveau/nouveau_bios.c
@@ -5259,6 +5259,17 @@ fixup_legacy_connector(struct nvbios *bios)
if (dcb->entry[i].i2c_index == 0xf)
continue;
+ /*
+ * Ignore the I2C index for on-chip TV-out, as there
+ * are cards with bogus values (nv31m in bug 23212),
+ * and it's otherwise useless.
+ */
+ if (dcb->entry[i].type == OUTPUT_TV &&
+ dcb->entry[i].location == DCB_LOC_ON_CHIP) {
+ dcb->entry[i].i2c_index = 0xf;
+ continue;
+ }
+
dcb->entry[i].connector = dcb->entry[i].i2c_index;
if (dcb->entry[i].connector > high)
high = dcb->entry[i].connector;
--
1.6.3.3
Francisco Jerez
2009-Oct-05 02:37 UTC
[Nouveau] [PATCH 2/3] drm/nv30-nv31: Don't use GPIO_EXT to switch the DACs between TV and VGA.
It locks the system up (bug 23212).
Signed-off-by: Francisco Jerez <currojerez at riseup.net>
---
drivers/gpu/drm/nouveau/nv04_dac.c | 4 ++--
drivers/gpu/drm/nouveau/nv17_tv.c | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/gpu/drm/nouveau/nv04_dac.c
b/drivers/gpu/drm/nouveau/nv04_dac.c
index 6a1db41..587b6f5 100644
--- a/drivers/gpu/drm/nouveau/nv04_dac.c
+++ b/drivers/gpu/drm/nouveau/nv04_dac.c
@@ -248,7 +248,7 @@ enum drm_connector_status nv17_dac_detect(struct drm_encoder
*encoder,
nvWriteMC(dev, NV_PBUS_POWERCTRL_4, saved_powerctrl_4 & 0xffffffcf);
}
- if (nv_arch(dev) >= NV_30) {
+ if (dev_priv->chipset >= 0x34) {
saved_gpio_ext = NVReadCRTC(dev, 0, NV_PCRTC_GPIO_EXT);
NVWriteCRTC(dev, 0, NV_PCRTC_GPIO_EXT, (saved_gpio_ext & ~(3 <<
20)) |
@@ -308,7 +308,7 @@ enum drm_connector_status nv17_dac_detect(struct drm_encoder
*encoder,
nvWriteMC(dev, NV_PBUS_POWERCTRL_4, saved_powerctrl_4);
nvWriteMC(dev, NV_PBUS_POWERCTRL_2, saved_powerctrl_2);
- if (nv_arch(dev) >= NV_30)
+ if (dev_priv->chipset >= 0x34)
NVWriteRAMDAC(dev, 0, NV_PCRTC_GPIO_EXT, saved_gpio_ext);
if (present) {
diff --git a/drivers/gpu/drm/nouveau/nv17_tv.c
b/drivers/gpu/drm/nouveau/nv17_tv.c
index a9a33e9..3856342 100644
--- a/drivers/gpu/drm/nouveau/nv17_tv.c
+++ b/drivers/gpu/drm/nouveau/nv17_tv.c
@@ -237,7 +237,7 @@ static void nv17_tv_dpms(struct drm_encoder *encoder, int
mode)
nv_load_ptv(dev, regs, 200);
- if (nv_arch(dev) >= NV_30) {
+ if (dev_priv->chipset >= 0x34) {
uint32_t *gpio_ext = &dev_priv->mode_reg.crtc_reg[0].gpio_ext;
*gpio_ext &= ~(3 << 20);
--
1.6.3.3
Francisco Jerez
2009-Oct-05 02:37 UTC
[Nouveau] [PATCH 3/3] drm/nouveau: Fix TV-out for the new semantics of drm_mode_vrefresh().
Signed-off-by: Francisco Jerez <currojerez at riseup.net>
---
drivers/gpu/drm/nouveau/nv17_tv.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/gpu/drm/nouveau/nv17_tv.c
b/drivers/gpu/drm/nouveau/nv17_tv.c
index 3856342..34f95c7 100644
--- a/drivers/gpu/drm/nouveau/nv17_tv.c
+++ b/drivers/gpu/drm/nouveau/nv17_tv.c
@@ -178,13 +178,13 @@ static int nv17_tv_mode_valid(struct drm_encoder *encoder,
return MODE_NO_DBLESCAN;
} else {
- const int vsync_tolerance = 10;
+ const int vsync_tolerance = 600;
if (mode->clock > 70000)
return MODE_CLOCK_HIGH;
- if (abs(drm_mode_vrefresh(mode) -
- tv_norm->tv_enc_mode.vrefresh) > vsync_tolerance)
+ if (abs(drm_mode_vrefresh(mode) * 1000 -
+ tv_norm->tv_enc_mode.vrefresh) > vsync_tolerance)
return MODE_VSYNC;
/* The encoder takes care of the actual interlacing */
--
1.6.3.3
Ben Skeggs
2009-Oct-05 07:44 UTC
[Nouveau] [PATCH 1/3] drm/nouveau: Ignore DCB I2C indices for on-chip TV-out.
On Mon, 2009-10-05 at 04:37 +0200, Francisco Jerez wrote:> The nv31m in bug 23212 claims its TV-out and LVDS are in the same > connector. Ignore it completely as it's otherwise useless.ACK for all three.> > Signed-off-by: Francisco Jerez <currojerez at riseup.net> > --- > drivers/gpu/drm/nouveau/nouveau_bios.c | 11 +++++++++++ > 1 files changed, 11 insertions(+), 0 deletions(-) > > diff --git a/drivers/gpu/drm/nouveau/nouveau_bios.c b/drivers/gpu/drm/nouveau/nouveau_bios.c > index 195ecb3..01ef97e 100644 > --- a/drivers/gpu/drm/nouveau/nouveau_bios.c > +++ b/drivers/gpu/drm/nouveau/nouveau_bios.c > @@ -5259,6 +5259,17 @@ fixup_legacy_connector(struct nvbios *bios) > if (dcb->entry[i].i2c_index == 0xf) > continue; > > + /* > + * Ignore the I2C index for on-chip TV-out, as there > + * are cards with bogus values (nv31m in bug 23212), > + * and it's otherwise useless. > + */ > + if (dcb->entry[i].type == OUTPUT_TV && > + dcb->entry[i].location == DCB_LOC_ON_CHIP) { > + dcb->entry[i].i2c_index = 0xf; > + continue; > + } > + > dcb->entry[i].connector = dcb->entry[i].i2c_index; > if (dcb->entry[i].connector > high) > high = dcb->entry[i].connector;
Seemingly Similar Threads
- [PATCH 00/12] TV-out modesetting kernel patches.
- [PATCHv2 01/10] drm/nouveau: Fix a lock up at NVSetOwner with nv11.
- [PATCH] drm/nouveau: use drm debug levels
- [PATCH] drm/nouveau: Add DRM_NOUVEAU_DEBUG option
- [Bug 23212] New: oops on rmmod nouveau with nv31m