summaryrefslogtreecommitdiff
path: root/shared-core
diff options
context:
space:
mode:
Diffstat (limited to 'shared-core')
-rw-r--r--shared-core/nouveau_drv.h5
-rw-r--r--shared-core/nouveau_reg.h6
-rw-r--r--shared-core/nouveau_state.c7
3 files changed, 18 insertions, 0 deletions
diff --git a/shared-core/nouveau_drv.h b/shared-core/nouveau_drv.h
index 158d6fde..1cd10bf9 100644
--- a/shared-core/nouveau_drv.h
+++ b/shared-core/nouveau_drv.h
@@ -318,6 +318,7 @@ struct drm_nouveau_private {
uint32_t *ramin_copy;
uint64_t ramin_size;
} susres;
+ struct backlight_device *backlight;
};
#define NOUVEAU_CHECK_INITIALISED_WITH_RETURN do { \
@@ -468,6 +469,10 @@ extern int nouveau_dma_channel_init(struct drm_device *);
extern void nouveau_dma_channel_takedown(struct drm_device *);
extern int nouveau_dma_wait(struct drm_device *, int size);
+/* nouveau_backlight.c */
+extern int nouveau_backlight_init(struct drm_device *);
+extern void nouveau_backlight_exit(struct drm_device *);
+
/* nv04_fb.c */
extern int nv04_fb_init(struct drm_device *);
extern void nv04_fb_takedown(struct drm_device *);
diff --git a/shared-core/nouveau_reg.h b/shared-core/nouveau_reg.h
index 1ae0177c..060abe0a 100644
--- a/shared-core/nouveau_reg.h
+++ b/shared-core/nouveau_reg.h
@@ -99,6 +99,8 @@
* the card will hang early on in the X init process.
*/
# define NV_PMC_ENABLE_UNK13 (1<<13)
+#define NV40_PMC_BACKLIGHT 0x000015f0
+# define NV40_PMC_BACKLIGHT_MASK 0x001f0000
#define NV40_PMC_1700 0x00001700
#define NV40_PMC_1704 0x00001704
#define NV40_PMC_1708 0x00001708
@@ -542,6 +544,9 @@
/* This name is a partial guess. */
#define NV50_DISPLAY_SUPERVISOR 0x00610024
+#define NV50_PDISPLAY_BACKLIGHT 0x0061c084
+# define NV50_PDISPLAY_BACKLIGHT_ENABLE 0x80000000
+
/* Fifo commands. These are not regs, neither masks */
#define NV03_FIFO_CMD_JUMP 0x20000000
#define NV03_FIFO_CMD_JUMP_OFFSET_MASK 0x1ffffffc
@@ -591,3 +596,4 @@
#define NV40_RAMFC_UNK_48 0x48
#define NV40_RAMFC_UNK_4C 0x4C
#define NV40_RAMFC_UNK_50 0x50
+
diff --git a/shared-core/nouveau_state.c b/shared-core/nouveau_state.c
index 0b6002ce..c9f43295 100644
--- a/shared-core/nouveau_state.c
+++ b/shared-core/nouveau_state.c
@@ -363,6 +363,11 @@ nouveau_card_init(struct drm_device *dev)
ret = nouveau_dma_channel_init(dev);
if (ret) return ret;
+ ret = nouveau_backlight_init(dev);
+ if (ret)
+ DRM_ERROR("Error code %d when trying to register backlight\n",
+ ret);
+
dev_priv->init_state = NOUVEAU_CARD_INIT_DONE;
return 0;
}
@@ -375,6 +380,8 @@ static void nouveau_card_takedown(struct drm_device *dev)
DRM_DEBUG("prev state = %d\n", dev_priv->init_state);
if (dev_priv->init_state != NOUVEAU_CARD_INIT_DOWN) {
+ nouveau_backlight_exit(dev);
+
nouveau_dma_channel_takedown(dev);
engine->fifo.takedown(dev);