aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/nouveau/nv04_dac.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/drm/nouveau/nv04_dac.c')
-rw-r--r--drivers/gpu/drm/nouveau/nv04_dac.c21
1 files changed, 19 insertions, 2 deletions
diff --git a/drivers/gpu/drm/nouveau/nv04_dac.c b/drivers/gpu/drm/nouveau/nv04_dac.c
index bcc8090adb2..2d0fee5f09c 100644
--- a/drivers/gpu/drm/nouveau/nv04_dac.c
+++ b/drivers/gpu/drm/nouveau/nv04_dac.c
@@ -314,9 +314,12 @@ nv17_dac_detect(struct drm_encoder *encoder, struct drm_connector *connector)
314{ 314{
315 struct drm_device *dev = encoder->dev; 315 struct drm_device *dev = encoder->dev;
316 struct dcb_entry *dcb = nouveau_encoder(encoder)->dcb; 316 struct dcb_entry *dcb = nouveau_encoder(encoder)->dcb;
317 uint32_t sample = nv17_dac_sample_load(encoder);
318 317
319 if (sample & NV_PRAMDAC_TEST_CONTROL_SENSEB_ALLHI) { 318 if (nv04_dac_in_use(encoder))
319 return connector_status_disconnected;
320
321 if (nv17_dac_sample_load(encoder) &
322 NV_PRAMDAC_TEST_CONTROL_SENSEB_ALLHI) {
320 NV_INFO(dev, "Load detected on output %c\n", 323 NV_INFO(dev, "Load detected on output %c\n",
321 '@' + ffs(dcb->or)); 324 '@' + ffs(dcb->or));
322 return connector_status_connected; 325 return connector_status_connected;
@@ -329,6 +332,9 @@ static bool nv04_dac_mode_fixup(struct drm_encoder *encoder,
329 struct drm_display_mode *mode, 332 struct drm_display_mode *mode,
330 struct drm_display_mode *adjusted_mode) 333 struct drm_display_mode *adjusted_mode)
331{ 334{
335 if (nv04_dac_in_use(encoder))
336 return false;
337
332 return true; 338 return true;
333} 339}
334 340
@@ -427,6 +433,17 @@ void nv04_dac_update_dacclk(struct drm_encoder *encoder, bool enable)
427 } 433 }
428} 434}
429 435
436/* Check if the DAC corresponding to 'encoder' is being used by
437 * someone else. */
438bool nv04_dac_in_use(struct drm_encoder *encoder)
439{
440 struct drm_nouveau_private *dev_priv = encoder->dev->dev_private;
441 struct dcb_entry *dcb = nouveau_encoder(encoder)->dcb;
442
443 return nv_gf4_disp_arch(encoder->dev) &&
444 (dev_priv->dac_users[ffs(dcb->or) - 1] & ~(1 << dcb->index));
445}
446
430static void nv04_dac_dpms(struct drm_encoder *encoder, int mode) 447static void nv04_dac_dpms(struct drm_encoder *encoder, int mode)
431{ 448{
432 struct drm_device *dev = encoder->dev; 449 struct drm_device *dev = encoder->dev;