diff options
author | Jesse Barnes <jbarnes@virtuousgeek.org> | 2011-06-28 16:00:41 -0400 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2011-06-29 23:37:22 -0400 |
commit | f71d4af4cd475aced6d9ec9730b03885ac80b833 (patch) | |
tree | 94cc3ab06f0d8d050cfb29bafac7d1896d5e9003 /drivers/gpu/drm/i915 | |
parent | 79d2427338e8da362678de32a1c8af1dc8a9810a (diff) |
drm/i915: move IRQ function table init to i915_irq.c
This lets us make the various IRQ functions static and helps avoid
problems like the one fixed in "drm/i915: Use chipset-specific irq
installers" where one of the exported functions was called rather than
the chipset specific version.
This also fixes a UMS-mode bug -- the correct irq functions for IRL
and later chips were only getting loaded in the KMS path.
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Reviewed-by: Ben Widawsky <ben@bwidawsk.net>
Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'drivers/gpu/drm/i915')
-rw-r--r-- | drivers/gpu/drm/i915/i915_dma.c | 31 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/i915_drv.c | 8 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/i915_drv.h | 30 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/i915_irq.c | 78 |
4 files changed, 60 insertions, 87 deletions
diff --git a/drivers/gpu/drm/i915/i915_dma.c b/drivers/gpu/drm/i915/i915_dma.c index 2b79588541e7..e1787022d6c8 100644 --- a/drivers/gpu/drm/i915/i915_dma.c +++ b/drivers/gpu/drm/i915/i915_dma.c | |||
@@ -1266,30 +1266,6 @@ static int i915_load_modeset_init(struct drm_device *dev) | |||
1266 | 1266 | ||
1267 | intel_modeset_gem_init(dev); | 1267 | intel_modeset_gem_init(dev); |
1268 | 1268 | ||
1269 | if (IS_IVYBRIDGE(dev)) { | ||
1270 | /* Share pre & uninstall handlers with ILK/SNB */ | ||
1271 | dev->driver->irq_handler = ivybridge_irq_handler; | ||
1272 | dev->driver->irq_preinstall = ironlake_irq_preinstall; | ||
1273 | dev->driver->irq_postinstall = ivybridge_irq_postinstall; | ||
1274 | dev->driver->irq_uninstall = ironlake_irq_uninstall; | ||
1275 | dev->driver->enable_vblank = ivybridge_enable_vblank; | ||
1276 | dev->driver->disable_vblank = ivybridge_disable_vblank; | ||
1277 | } else if (HAS_PCH_SPLIT(dev)) { | ||
1278 | dev->driver->irq_handler = ironlake_irq_handler; | ||
1279 | dev->driver->irq_preinstall = ironlake_irq_preinstall; | ||
1280 | dev->driver->irq_postinstall = ironlake_irq_postinstall; | ||
1281 | dev->driver->irq_uninstall = ironlake_irq_uninstall; | ||
1282 | dev->driver->enable_vblank = ironlake_enable_vblank; | ||
1283 | dev->driver->disable_vblank = ironlake_disable_vblank; | ||
1284 | } else { | ||
1285 | dev->driver->irq_preinstall = i915_driver_irq_preinstall; | ||
1286 | dev->driver->irq_postinstall = i915_driver_irq_postinstall; | ||
1287 | dev->driver->irq_uninstall = i915_driver_irq_uninstall; | ||
1288 | dev->driver->irq_handler = i915_driver_irq_handler; | ||
1289 | dev->driver->enable_vblank = i915_enable_vblank; | ||
1290 | dev->driver->disable_vblank = i915_disable_vblank; | ||
1291 | } | ||
1292 | |||
1293 | ret = drm_irq_install(dev); | 1269 | ret = drm_irq_install(dev); |
1294 | if (ret) | 1270 | if (ret) |
1295 | goto cleanup_gem; | 1271 | goto cleanup_gem; |
@@ -2017,12 +1993,7 @@ int i915_driver_load(struct drm_device *dev, unsigned long flags) | |||
2017 | /* enable GEM by default */ | 1993 | /* enable GEM by default */ |
2018 | dev_priv->has_gem = 1; | 1994 | dev_priv->has_gem = 1; |
2019 | 1995 | ||
2020 | dev->driver->get_vblank_counter = i915_get_vblank_counter; | 1996 | intel_irq_init(dev); |
2021 | dev->max_vblank_count = 0xffffff; /* only 24 bits of frame count */ | ||
2022 | if (IS_G4X(dev) || IS_GEN5(dev) || IS_GEN6(dev) || IS_IVYBRIDGE(dev)) { | ||
2023 | dev->max_vblank_count = 0xffffffff; /* full 32 bit counter */ | ||
2024 | dev->driver->get_vblank_counter = gm45_get_vblank_counter; | ||
2025 | } | ||
2026 | 1997 | ||
2027 | /* Try to make sure MCHBAR is enabled before poking at it */ | 1998 | /* Try to make sure MCHBAR is enabled before poking at it */ |
2028 | intel_setup_mchbar(dev); | 1999 | intel_setup_mchbar(dev); |
diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c index 609358faaa90..013d304455b9 100644 --- a/drivers/gpu/drm/i915/i915_drv.c +++ b/drivers/gpu/drm/i915/i915_drv.c | |||
@@ -765,14 +765,6 @@ static struct drm_driver driver = { | |||
765 | .resume = i915_resume, | 765 | .resume = i915_resume, |
766 | 766 | ||
767 | .device_is_agp = i915_driver_device_is_agp, | 767 | .device_is_agp = i915_driver_device_is_agp, |
768 | .enable_vblank = i915_enable_vblank, | ||
769 | .disable_vblank = i915_disable_vblank, | ||
770 | .get_vblank_timestamp = i915_get_vblank_timestamp, | ||
771 | .get_scanout_position = i915_get_crtc_scanoutpos, | ||
772 | .irq_preinstall = i915_driver_irq_preinstall, | ||
773 | .irq_postinstall = i915_driver_irq_postinstall, | ||
774 | .irq_uninstall = i915_driver_irq_uninstall, | ||
775 | .irq_handler = i915_driver_irq_handler, | ||
776 | .reclaim_buffers = drm_core_reclaim_buffers, | 768 | .reclaim_buffers = drm_core_reclaim_buffers, |
777 | .master_create = i915_master_create, | 769 | .master_create = i915_master_create, |
778 | .master_destroy = i915_master_destroy, | 770 | .master_destroy = i915_master_destroy, |
diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h index 1c8bfb1300d7..f245c588ae95 100644 --- a/drivers/gpu/drm/i915/i915_drv.h +++ b/drivers/gpu/drm/i915/i915_drv.h | |||
@@ -1031,33 +1031,12 @@ extern int i915_irq_emit(struct drm_device *dev, void *data, | |||
1031 | extern int i915_irq_wait(struct drm_device *dev, void *data, | 1031 | extern int i915_irq_wait(struct drm_device *dev, void *data, |
1032 | struct drm_file *file_priv); | 1032 | struct drm_file *file_priv); |
1033 | 1033 | ||
1034 | extern irqreturn_t i915_driver_irq_handler(DRM_IRQ_ARGS); | 1034 | extern void intel_irq_init(struct drm_device *dev); |
1035 | extern void i915_driver_irq_preinstall(struct drm_device * dev); | ||
1036 | extern int i915_driver_irq_postinstall(struct drm_device *dev); | ||
1037 | extern void i915_driver_irq_uninstall(struct drm_device * dev); | ||
1038 | |||
1039 | extern irqreturn_t ironlake_irq_handler(DRM_IRQ_ARGS); | ||
1040 | extern void ironlake_irq_preinstall(struct drm_device *dev); | ||
1041 | extern int ironlake_irq_postinstall(struct drm_device *dev); | ||
1042 | extern void ironlake_irq_uninstall(struct drm_device *dev); | ||
1043 | |||
1044 | extern irqreturn_t ivybridge_irq_handler(DRM_IRQ_ARGS); | ||
1045 | extern void ivybridge_irq_preinstall(struct drm_device *dev); | ||
1046 | extern int ivybridge_irq_postinstall(struct drm_device *dev); | ||
1047 | extern void ivybridge_irq_uninstall(struct drm_device *dev); | ||
1048 | 1035 | ||
1049 | extern int i915_vblank_pipe_set(struct drm_device *dev, void *data, | 1036 | extern int i915_vblank_pipe_set(struct drm_device *dev, void *data, |
1050 | struct drm_file *file_priv); | 1037 | struct drm_file *file_priv); |
1051 | extern int i915_vblank_pipe_get(struct drm_device *dev, void *data, | 1038 | extern int i915_vblank_pipe_get(struct drm_device *dev, void *data, |
1052 | struct drm_file *file_priv); | 1039 | struct drm_file *file_priv); |
1053 | extern int i915_enable_vblank(struct drm_device *dev, int crtc); | ||
1054 | extern void i915_disable_vblank(struct drm_device *dev, int crtc); | ||
1055 | extern int ironlake_enable_vblank(struct drm_device *dev, int crtc); | ||
1056 | extern void ironlake_disable_vblank(struct drm_device *dev, int crtc); | ||
1057 | extern int ivybridge_enable_vblank(struct drm_device *dev, int crtc); | ||
1058 | extern void ivybridge_disable_vblank(struct drm_device *dev, int crtc); | ||
1059 | extern u32 i915_get_vblank_counter(struct drm_device *dev, int crtc); | ||
1060 | extern u32 gm45_get_vblank_counter(struct drm_device *dev, int crtc); | ||
1061 | extern int i915_vblank_swap(struct drm_device *dev, void *data, | 1040 | extern int i915_vblank_swap(struct drm_device *dev, void *data, |
1062 | struct drm_file *file_priv); | 1041 | struct drm_file *file_priv); |
1063 | 1042 | ||
@@ -1068,13 +1047,6 @@ void | |||
1068 | i915_disable_pipestat(drm_i915_private_t *dev_priv, int pipe, u32 mask); | 1047 | i915_disable_pipestat(drm_i915_private_t *dev_priv, int pipe, u32 mask); |
1069 | 1048 | ||
1070 | void intel_enable_asle (struct drm_device *dev); | 1049 | void intel_enable_asle (struct drm_device *dev); |
1071 | int i915_get_vblank_timestamp(struct drm_device *dev, int crtc, | ||
1072 | int *max_error, | ||
1073 | struct timeval *vblank_time, | ||
1074 | unsigned flags); | ||
1075 | |||
1076 | int i915_get_crtc_scanoutpos(struct drm_device *dev, int pipe, | ||
1077 | int *vpos, int *hpos); | ||
1078 | 1050 | ||
1079 | #ifdef CONFIG_DEBUG_FS | 1051 | #ifdef CONFIG_DEBUG_FS |
1080 | extern void i915_destroy_error_state(struct drm_device *dev); | 1052 | extern void i915_destroy_error_state(struct drm_device *dev); |
diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c index ae2b49969b99..226d8b296e69 100644 --- a/drivers/gpu/drm/i915/i915_irq.c +++ b/drivers/gpu/drm/i915/i915_irq.c | |||
@@ -152,7 +152,7 @@ i915_pipe_enabled(struct drm_device *dev, int pipe) | |||
152 | /* Called from drm generic code, passed a 'crtc', which | 152 | /* Called from drm generic code, passed a 'crtc', which |
153 | * we use as a pipe index | 153 | * we use as a pipe index |
154 | */ | 154 | */ |
155 | u32 i915_get_vblank_counter(struct drm_device *dev, int pipe) | 155 | static u32 i915_get_vblank_counter(struct drm_device *dev, int pipe) |
156 | { | 156 | { |
157 | drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private; | 157 | drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private; |
158 | unsigned long high_frame; | 158 | unsigned long high_frame; |
@@ -184,7 +184,7 @@ u32 i915_get_vblank_counter(struct drm_device *dev, int pipe) | |||
184 | return (high1 << 8) | low; | 184 | return (high1 << 8) | low; |
185 | } | 185 | } |
186 | 186 | ||
187 | u32 gm45_get_vblank_counter(struct drm_device *dev, int pipe) | 187 | static u32 gm45_get_vblank_counter(struct drm_device *dev, int pipe) |
188 | { | 188 | { |
189 | drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private; | 189 | drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private; |
190 | int reg = PIPE_FRMCOUNT_GM45(pipe); | 190 | int reg = PIPE_FRMCOUNT_GM45(pipe); |
@@ -198,7 +198,7 @@ u32 gm45_get_vblank_counter(struct drm_device *dev, int pipe) | |||
198 | return I915_READ(reg); | 198 | return I915_READ(reg); |
199 | } | 199 | } |
200 | 200 | ||
201 | int i915_get_crtc_scanoutpos(struct drm_device *dev, int pipe, | 201 | static int i915_get_crtc_scanoutpos(struct drm_device *dev, int pipe, |
202 | int *vpos, int *hpos) | 202 | int *vpos, int *hpos) |
203 | { | 203 | { |
204 | drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private; | 204 | drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private; |
@@ -264,7 +264,7 @@ int i915_get_crtc_scanoutpos(struct drm_device *dev, int pipe, | |||
264 | return ret; | 264 | return ret; |
265 | } | 265 | } |
266 | 266 | ||
267 | int i915_get_vblank_timestamp(struct drm_device *dev, int pipe, | 267 | static int i915_get_vblank_timestamp(struct drm_device *dev, int pipe, |
268 | int *max_error, | 268 | int *max_error, |
269 | struct timeval *vblank_time, | 269 | struct timeval *vblank_time, |
270 | unsigned flags) | 270 | unsigned flags) |
@@ -462,7 +462,7 @@ static void pch_irq_handler(struct drm_device *dev) | |||
462 | DRM_DEBUG_DRIVER("PCH transcoder A underrun interrupt\n"); | 462 | DRM_DEBUG_DRIVER("PCH transcoder A underrun interrupt\n"); |
463 | } | 463 | } |
464 | 464 | ||
465 | irqreturn_t ivybridge_irq_handler(DRM_IRQ_ARGS) | 465 | static irqreturn_t ivybridge_irq_handler(DRM_IRQ_ARGS) |
466 | { | 466 | { |
467 | struct drm_device *dev = (struct drm_device *) arg; | 467 | struct drm_device *dev = (struct drm_device *) arg; |
468 | drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private; | 468 | drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private; |
@@ -550,7 +550,7 @@ done: | |||
550 | return ret; | 550 | return ret; |
551 | } | 551 | } |
552 | 552 | ||
553 | irqreturn_t ironlake_irq_handler(DRM_IRQ_ARGS) | 553 | static irqreturn_t ironlake_irq_handler(DRM_IRQ_ARGS) |
554 | { | 554 | { |
555 | struct drm_device *dev = (struct drm_device *) arg; | 555 | struct drm_device *dev = (struct drm_device *) arg; |
556 | drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private; | 556 | drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private; |
@@ -1209,7 +1209,7 @@ static void i915_pageflip_stall_check(struct drm_device *dev, int pipe) | |||
1209 | } | 1209 | } |
1210 | } | 1210 | } |
1211 | 1211 | ||
1212 | irqreturn_t i915_driver_irq_handler(DRM_IRQ_ARGS) | 1212 | static irqreturn_t i915_driver_irq_handler(DRM_IRQ_ARGS) |
1213 | { | 1213 | { |
1214 | struct drm_device *dev = (struct drm_device *) arg; | 1214 | struct drm_device *dev = (struct drm_device *) arg; |
1215 | drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private; | 1215 | drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private; |
@@ -1454,7 +1454,7 @@ int i915_irq_wait(struct drm_device *dev, void *data, | |||
1454 | /* Called from drm generic code, passed 'crtc' which | 1454 | /* Called from drm generic code, passed 'crtc' which |
1455 | * we use as a pipe index | 1455 | * we use as a pipe index |
1456 | */ | 1456 | */ |
1457 | int i915_enable_vblank(struct drm_device *dev, int pipe) | 1457 | static int i915_enable_vblank(struct drm_device *dev, int pipe) |
1458 | { | 1458 | { |
1459 | drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private; | 1459 | drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private; |
1460 | unsigned long irqflags; | 1460 | unsigned long irqflags; |
@@ -1478,7 +1478,7 @@ int i915_enable_vblank(struct drm_device *dev, int pipe) | |||
1478 | return 0; | 1478 | return 0; |
1479 | } | 1479 | } |
1480 | 1480 | ||
1481 | int ironlake_enable_vblank(struct drm_device *dev, int pipe) | 1481 | static int ironlake_enable_vblank(struct drm_device *dev, int pipe) |
1482 | { | 1482 | { |
1483 | drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private; | 1483 | drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private; |
1484 | unsigned long irqflags; | 1484 | unsigned long irqflags; |
@@ -1494,7 +1494,7 @@ int ironlake_enable_vblank(struct drm_device *dev, int pipe) | |||
1494 | return 0; | 1494 | return 0; |
1495 | } | 1495 | } |
1496 | 1496 | ||
1497 | int ivybridge_enable_vblank(struct drm_device *dev, int pipe) | 1497 | static int ivybridge_enable_vblank(struct drm_device *dev, int pipe) |
1498 | { | 1498 | { |
1499 | drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private; | 1499 | drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private; |
1500 | unsigned long irqflags; | 1500 | unsigned long irqflags; |
@@ -1513,7 +1513,7 @@ int ivybridge_enable_vblank(struct drm_device *dev, int pipe) | |||
1513 | /* Called from drm generic code, passed 'crtc' which | 1513 | /* Called from drm generic code, passed 'crtc' which |
1514 | * we use as a pipe index | 1514 | * we use as a pipe index |
1515 | */ | 1515 | */ |
1516 | void i915_disable_vblank(struct drm_device *dev, int pipe) | 1516 | static void i915_disable_vblank(struct drm_device *dev, int pipe) |
1517 | { | 1517 | { |
1518 | drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private; | 1518 | drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private; |
1519 | unsigned long irqflags; | 1519 | unsigned long irqflags; |
@@ -1529,7 +1529,7 @@ void i915_disable_vblank(struct drm_device *dev, int pipe) | |||
1529 | spin_unlock_irqrestore(&dev_priv->irq_lock, irqflags); | 1529 | spin_unlock_irqrestore(&dev_priv->irq_lock, irqflags); |
1530 | } | 1530 | } |
1531 | 1531 | ||
1532 | void ironlake_disable_vblank(struct drm_device *dev, int pipe) | 1532 | static void ironlake_disable_vblank(struct drm_device *dev, int pipe) |
1533 | { | 1533 | { |
1534 | drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private; | 1534 | drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private; |
1535 | unsigned long irqflags; | 1535 | unsigned long irqflags; |
@@ -1540,7 +1540,7 @@ void ironlake_disable_vblank(struct drm_device *dev, int pipe) | |||
1540 | spin_unlock_irqrestore(&dev_priv->irq_lock, irqflags); | 1540 | spin_unlock_irqrestore(&dev_priv->irq_lock, irqflags); |
1541 | } | 1541 | } |
1542 | 1542 | ||
1543 | void ivybridge_disable_vblank(struct drm_device *dev, int pipe) | 1543 | static void ivybridge_disable_vblank(struct drm_device *dev, int pipe) |
1544 | { | 1544 | { |
1545 | drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private; | 1545 | drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private; |
1546 | unsigned long irqflags; | 1546 | unsigned long irqflags; |
@@ -1728,7 +1728,7 @@ repeat: | |||
1728 | 1728 | ||
1729 | /* drm_dma.h hooks | 1729 | /* drm_dma.h hooks |
1730 | */ | 1730 | */ |
1731 | void ironlake_irq_preinstall(struct drm_device *dev) | 1731 | static void ironlake_irq_preinstall(struct drm_device *dev) |
1732 | { | 1732 | { |
1733 | drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private; | 1733 | drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private; |
1734 | 1734 | ||
@@ -1769,7 +1769,7 @@ void ironlake_irq_preinstall(struct drm_device *dev) | |||
1769 | POSTING_READ(SDEIER); | 1769 | POSTING_READ(SDEIER); |
1770 | } | 1770 | } |
1771 | 1771 | ||
1772 | int ironlake_irq_postinstall(struct drm_device *dev) | 1772 | static int ironlake_irq_postinstall(struct drm_device *dev) |
1773 | { | 1773 | { |
1774 | drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private; | 1774 | drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private; |
1775 | /* enable kind of interrupts always enabled */ | 1775 | /* enable kind of interrupts always enabled */ |
@@ -1841,7 +1841,7 @@ int ironlake_irq_postinstall(struct drm_device *dev) | |||
1841 | return 0; | 1841 | return 0; |
1842 | } | 1842 | } |
1843 | 1843 | ||
1844 | int ivybridge_irq_postinstall(struct drm_device *dev) | 1844 | static int ivybridge_irq_postinstall(struct drm_device *dev) |
1845 | { | 1845 | { |
1846 | drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private; | 1846 | drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private; |
1847 | /* enable kind of interrupts always enabled */ | 1847 | /* enable kind of interrupts always enabled */ |
@@ -1891,7 +1891,7 @@ int ivybridge_irq_postinstall(struct drm_device *dev) | |||
1891 | return 0; | 1891 | return 0; |
1892 | } | 1892 | } |
1893 | 1893 | ||
1894 | void i915_driver_irq_preinstall(struct drm_device * dev) | 1894 | static void i915_driver_irq_preinstall(struct drm_device * dev) |
1895 | { | 1895 | { |
1896 | drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private; | 1896 | drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private; |
1897 | int pipe; | 1897 | int pipe; |
@@ -1918,7 +1918,7 @@ void i915_driver_irq_preinstall(struct drm_device * dev) | |||
1918 | * Must be called after intel_modeset_init or hotplug interrupts won't be | 1918 | * Must be called after intel_modeset_init or hotplug interrupts won't be |
1919 | * enabled correctly. | 1919 | * enabled correctly. |
1920 | */ | 1920 | */ |
1921 | int i915_driver_irq_postinstall(struct drm_device *dev) | 1921 | static int i915_driver_irq_postinstall(struct drm_device *dev) |
1922 | { | 1922 | { |
1923 | drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private; | 1923 | drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private; |
1924 | u32 enable_mask = I915_INTERRUPT_ENABLE_FIX | I915_INTERRUPT_ENABLE_VAR; | 1924 | u32 enable_mask = I915_INTERRUPT_ENABLE_FIX | I915_INTERRUPT_ENABLE_VAR; |
@@ -1994,7 +1994,7 @@ int i915_driver_irq_postinstall(struct drm_device *dev) | |||
1994 | return 0; | 1994 | return 0; |
1995 | } | 1995 | } |
1996 | 1996 | ||
1997 | void ironlake_irq_uninstall(struct drm_device *dev) | 1997 | static void ironlake_irq_uninstall(struct drm_device *dev) |
1998 | { | 1998 | { |
1999 | drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private; | 1999 | drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private; |
2000 | 2000 | ||
@@ -2014,7 +2014,7 @@ void ironlake_irq_uninstall(struct drm_device *dev) | |||
2014 | I915_WRITE(GTIIR, I915_READ(GTIIR)); | 2014 | I915_WRITE(GTIIR, I915_READ(GTIIR)); |
2015 | } | 2015 | } |
2016 | 2016 | ||
2017 | void i915_driver_irq_uninstall(struct drm_device * dev) | 2017 | static void i915_driver_irq_uninstall(struct drm_device * dev) |
2018 | { | 2018 | { |
2019 | drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private; | 2019 | drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private; |
2020 | int pipe; | 2020 | int pipe; |
@@ -2040,3 +2040,41 @@ void i915_driver_irq_uninstall(struct drm_device * dev) | |||
2040 | I915_READ(PIPESTAT(pipe)) & 0x8000ffff); | 2040 | I915_READ(PIPESTAT(pipe)) & 0x8000ffff); |
2041 | I915_WRITE(IIR, I915_READ(IIR)); | 2041 | I915_WRITE(IIR, I915_READ(IIR)); |
2042 | } | 2042 | } |
2043 | |||
2044 | void intel_irq_init(struct drm_device *dev) | ||
2045 | { | ||
2046 | dev->driver->get_vblank_counter = i915_get_vblank_counter; | ||
2047 | dev->max_vblank_count = 0xffffff; /* only 24 bits of frame count */ | ||
2048 | if (IS_G4X(dev) || IS_GEN5(dev) || IS_GEN6(dev) || IS_IVYBRIDGE(dev)) { | ||
2049 | dev->max_vblank_count = 0xffffffff; /* full 32 bit counter */ | ||
2050 | dev->driver->get_vblank_counter = gm45_get_vblank_counter; | ||
2051 | } | ||
2052 | |||
2053 | |||
2054 | dev->driver->get_vblank_timestamp = i915_get_vblank_timestamp; | ||
2055 | dev->driver->get_scanout_position = i915_get_crtc_scanoutpos; | ||
2056 | |||
2057 | if (IS_IVYBRIDGE(dev)) { | ||
2058 | /* Share pre & uninstall handlers with ILK/SNB */ | ||
2059 | dev->driver->irq_handler = ivybridge_irq_handler; | ||
2060 | dev->driver->irq_preinstall = ironlake_irq_preinstall; | ||
2061 | dev->driver->irq_postinstall = ivybridge_irq_postinstall; | ||
2062 | dev->driver->irq_uninstall = ironlake_irq_uninstall; | ||
2063 | dev->driver->enable_vblank = ivybridge_enable_vblank; | ||
2064 | dev->driver->disable_vblank = ivybridge_disable_vblank; | ||
2065 | } else if (HAS_PCH_SPLIT(dev)) { | ||
2066 | dev->driver->irq_handler = ironlake_irq_handler; | ||
2067 | dev->driver->irq_preinstall = ironlake_irq_preinstall; | ||
2068 | dev->driver->irq_postinstall = ironlake_irq_postinstall; | ||
2069 | dev->driver->irq_uninstall = ironlake_irq_uninstall; | ||
2070 | dev->driver->enable_vblank = ironlake_enable_vblank; | ||
2071 | dev->driver->disable_vblank = ironlake_disable_vblank; | ||
2072 | } else { | ||
2073 | dev->driver->irq_preinstall = i915_driver_irq_preinstall; | ||
2074 | dev->driver->irq_postinstall = i915_driver_irq_postinstall; | ||
2075 | dev->driver->irq_uninstall = i915_driver_irq_uninstall; | ||
2076 | dev->driver->irq_handler = i915_driver_irq_handler; | ||
2077 | dev->driver->enable_vblank = i915_enable_vblank; | ||
2078 | dev->driver->disable_vblank = i915_disable_vblank; | ||
2079 | } | ||
2080 | } | ||