drm/nouveau: move hpd enable/disable to common code
No idea why I didn't do this initially... NVD9 HPD is now enabled. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
This commit is contained in:
parent
47e5d5cb83
commit
52c4d76743
|
@ -33,6 +33,7 @@
|
||||||
#include "nouveau_crtc.h"
|
#include "nouveau_crtc.h"
|
||||||
#include "nouveau_dma.h"
|
#include "nouveau_dma.h"
|
||||||
#include "nouveau_connector.h"
|
#include "nouveau_connector.h"
|
||||||
|
#include "nouveau_gpio.h"
|
||||||
#include "nv50_display.h"
|
#include "nv50_display.h"
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -211,11 +212,19 @@ nouveau_display_init(struct drm_device *dev)
|
||||||
{
|
{
|
||||||
struct drm_nouveau_private *dev_priv = dev->dev_private;
|
struct drm_nouveau_private *dev_priv = dev->dev_private;
|
||||||
struct nouveau_display_engine *disp = &dev_priv->engine.display;
|
struct nouveau_display_engine *disp = &dev_priv->engine.display;
|
||||||
|
struct drm_connector *connector;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
ret = disp->init(dev);
|
ret = disp->init(dev);
|
||||||
if (ret == 0) {
|
if (ret)
|
||||||
drm_kms_helper_poll_enable(dev);
|
return ret;
|
||||||
|
|
||||||
|
drm_kms_helper_poll_enable(dev);
|
||||||
|
|
||||||
|
/* enable hotplug interrupts */
|
||||||
|
list_for_each_entry(connector, &dev->mode_config.connector_list, head) {
|
||||||
|
struct nouveau_connector *conn = nouveau_connector(connector);
|
||||||
|
nouveau_gpio_irq(dev, 0, conn->hpd, 0xff, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
|
@ -226,6 +235,13 @@ nouveau_display_fini(struct drm_device *dev)
|
||||||
{
|
{
|
||||||
struct drm_nouveau_private *dev_priv = dev->dev_private;
|
struct drm_nouveau_private *dev_priv = dev->dev_private;
|
||||||
struct nouveau_display_engine *disp = &dev_priv->engine.display;
|
struct nouveau_display_engine *disp = &dev_priv->engine.display;
|
||||||
|
struct drm_connector *connector;
|
||||||
|
|
||||||
|
/* disable hotplug interrupts */
|
||||||
|
list_for_each_entry(connector, &dev->mode_config.connector_list, head) {
|
||||||
|
struct nouveau_connector *conn = nouveau_connector(connector);
|
||||||
|
nouveau_gpio_irq(dev, 0, conn->hpd, 0xff, false);
|
||||||
|
}
|
||||||
|
|
||||||
drm_kms_helper_poll_disable(dev);
|
drm_kms_helper_poll_disable(dev);
|
||||||
disp->fini(dev);
|
disp->fini(dev);
|
||||||
|
|
|
@ -31,7 +31,6 @@
|
||||||
#include "nouveau_hw.h"
|
#include "nouveau_hw.h"
|
||||||
#include "nouveau_encoder.h"
|
#include "nouveau_encoder.h"
|
||||||
#include "nouveau_connector.h"
|
#include "nouveau_connector.h"
|
||||||
#include "nouveau_gpio.h"
|
|
||||||
|
|
||||||
static void nv04_vblank_crtc0_isr(struct drm_device *);
|
static void nv04_vblank_crtc0_isr(struct drm_device *);
|
||||||
static void nv04_vblank_crtc1_isr(struct drm_device *);
|
static void nv04_vblank_crtc1_isr(struct drm_device *);
|
||||||
|
@ -221,7 +220,6 @@ nv04_display_destroy(struct drm_device *dev)
|
||||||
int
|
int
|
||||||
nv04_display_init(struct drm_device *dev)
|
nv04_display_init(struct drm_device *dev)
|
||||||
{
|
{
|
||||||
struct drm_connector *connector;
|
|
||||||
struct drm_encoder *encoder;
|
struct drm_encoder *encoder;
|
||||||
struct drm_crtc *crtc;
|
struct drm_crtc *crtc;
|
||||||
|
|
||||||
|
@ -242,12 +240,6 @@ nv04_display_init(struct drm_device *dev)
|
||||||
list_for_each_entry(crtc, &dev->mode_config.crtc_list, head)
|
list_for_each_entry(crtc, &dev->mode_config.crtc_list, head)
|
||||||
crtc->funcs->restore(crtc);
|
crtc->funcs->restore(crtc);
|
||||||
|
|
||||||
/* enable hotplug interrupts */
|
|
||||||
list_for_each_entry(connector, &dev->mode_config.connector_list, head) {
|
|
||||||
struct nouveau_connector *conn = nouveau_connector(connector);
|
|
||||||
nouveau_gpio_irq(dev, 0, conn->hpd, 0xff, true);
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -32,7 +32,6 @@
|
||||||
#include "nouveau_fb.h"
|
#include "nouveau_fb.h"
|
||||||
#include "nouveau_fbcon.h"
|
#include "nouveau_fbcon.h"
|
||||||
#include "nouveau_ramht.h"
|
#include "nouveau_ramht.h"
|
||||||
#include "nouveau_gpio.h"
|
|
||||||
#include "drm_crtc_helper.h"
|
#include "drm_crtc_helper.h"
|
||||||
|
|
||||||
static void nv50_display_isr(struct drm_device *);
|
static void nv50_display_isr(struct drm_device *);
|
||||||
|
@ -141,7 +140,6 @@ nv50_display_sync(struct drm_device *dev)
|
||||||
int
|
int
|
||||||
nv50_display_init(struct drm_device *dev)
|
nv50_display_init(struct drm_device *dev)
|
||||||
{
|
{
|
||||||
struct drm_connector *connector;
|
|
||||||
struct nouveau_channel *evo;
|
struct nouveau_channel *evo;
|
||||||
int ret, i;
|
int ret, i;
|
||||||
u32 val;
|
u32 val;
|
||||||
|
@ -236,12 +234,6 @@ nv50_display_init(struct drm_device *dev)
|
||||||
NV50_PDISPLAY_INTR_EN_1_CLK_UNK20 |
|
NV50_PDISPLAY_INTR_EN_1_CLK_UNK20 |
|
||||||
NV50_PDISPLAY_INTR_EN_1_CLK_UNK40);
|
NV50_PDISPLAY_INTR_EN_1_CLK_UNK40);
|
||||||
|
|
||||||
/* enable hotplug interrupts */
|
|
||||||
list_for_each_entry(connector, &dev->mode_config.connector_list, head) {
|
|
||||||
struct nouveau_connector *conn = nouveau_connector(connector);
|
|
||||||
nouveau_gpio_irq(dev, 0, conn->hpd, 0xff, true);
|
|
||||||
}
|
|
||||||
|
|
||||||
ret = nv50_evo_init(dev);
|
ret = nv50_evo_init(dev);
|
||||||
if (ret)
|
if (ret)
|
||||||
return ret;
|
return ret;
|
||||||
|
@ -262,7 +254,6 @@ nv50_display_init(struct drm_device *dev)
|
||||||
void
|
void
|
||||||
nv50_display_fini(struct drm_device *dev)
|
nv50_display_fini(struct drm_device *dev)
|
||||||
{
|
{
|
||||||
struct drm_nouveau_private *dev_priv = dev->dev_private;
|
|
||||||
struct nv50_display *disp = nv50_display(dev);
|
struct nv50_display *disp = nv50_display(dev);
|
||||||
struct nouveau_channel *evo = disp->master;
|
struct nouveau_channel *evo = disp->master;
|
||||||
struct drm_crtc *drm_crtc;
|
struct drm_crtc *drm_crtc;
|
||||||
|
@ -325,14 +316,6 @@ nv50_display_fini(struct drm_device *dev)
|
||||||
|
|
||||||
/* disable interrupts. */
|
/* disable interrupts. */
|
||||||
nv_wr32(dev, NV50_PDISPLAY_INTR_EN_1, 0x00000000);
|
nv_wr32(dev, NV50_PDISPLAY_INTR_EN_1, 0x00000000);
|
||||||
|
|
||||||
/* disable hotplug interrupts */
|
|
||||||
nv_wr32(dev, 0xe054, 0xffffffff);
|
|
||||||
nv_wr32(dev, 0xe050, 0x00000000);
|
|
||||||
if (dev_priv->chipset >= 0x90) {
|
|
||||||
nv_wr32(dev, 0xe074, 0xffffffff);
|
|
||||||
nv_wr32(dev, 0xe070, 0x00000000);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
|
|
Loading…
Reference in a new issue