aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/drm_irq.c
diff options
context:
space:
mode:
authorDaniel Vetter <daniel.vetter@ffwll.ch>2016-11-14 04:02:54 -0500
committerDaniel Vetter <daniel.vetter@ffwll.ch>2016-11-15 17:33:48 -0500
commit2d1e331fa942c963a92f50e3a2a5761fee006369 (patch)
treeab7700527edefc8cd8d93ec1eb854d8652c6f85e /drivers/gpu/drm/drm_irq.c
parentd6b0f626375739b1faa2d9dfbca335a923b2a760 (diff)
drm/irq: Unexport drm_vblank_on/off
Only remaining use was in amdgpu, and trivial to convert over to drm_crtc_vblank_* variants. Cc: Alex Deucher <alexander.deucher@amd.com> Cc: Christian König <christian.koenig@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com> Link: http://patchwork.freedesktop.org/patch/msgid/20161114090255.31595-5-daniel.vetter@ffwll.ch
Diffstat (limited to 'drivers/gpu/drm/drm_irq.c')
-rw-r--r--drivers/gpu/drm/drm_irq.c80
1 files changed, 21 insertions, 59 deletions
diff --git a/drivers/gpu/drm/drm_irq.c b/drivers/gpu/drm/drm_irq.c
index 1681e919b866..273625a85036 100644
--- a/drivers/gpu/drm/drm_irq.c
+++ b/drivers/gpu/drm/drm_irq.c
@@ -93,7 +93,7 @@ static void store_vblank(struct drm_device *dev, unsigned int pipe,
93 * Reset the stored timestamp for the current vblank count to correspond 93 * Reset the stored timestamp for the current vblank count to correspond
94 * to the last vblank occurred. 94 * to the last vblank occurred.
95 * 95 *
96 * Only to be called from drm_vblank_on(). 96 * Only to be called from drm_crtc_vblank_on().
97 * 97 *
98 * Note: caller must hold dev->vbl_lock since this reads & writes 98 * Note: caller must hold dev->vbl_lock since this reads & writes
99 * device vblank fields. 99 * device vblank fields.
@@ -306,7 +306,7 @@ static void vblank_disable_and_save(struct drm_device *dev, unsigned int pipe)
306 * Always update the count and timestamp to maintain the 306 * Always update the count and timestamp to maintain the
307 * appearance that the counter has been ticking all along until 307 * appearance that the counter has been ticking all along until
308 * this time. This makes the count account for the entire time 308 * this time. This makes the count account for the entire time
309 * between drm_vblank_on() and drm_vblank_off(). 309 * between drm_crtc_vblank_on() and drm_crtc_vblank_off().
310 */ 310 */
311 drm_update_vblank_count(dev, pipe, 0); 311 drm_update_vblank_count(dev, pipe, 0);
312 312
@@ -1255,21 +1255,20 @@ void drm_crtc_wait_one_vblank(struct drm_crtc *crtc)
1255EXPORT_SYMBOL(drm_crtc_wait_one_vblank); 1255EXPORT_SYMBOL(drm_crtc_wait_one_vblank);
1256 1256
1257/** 1257/**
1258 * drm_vblank_off - disable vblank events on a CRTC 1258 * drm_crtc_vblank_off - disable vblank events on a CRTC
1259 * @dev: DRM device 1259 * @crtc: CRTC in question
1260 * @pipe: CRTC index
1261 * 1260 *
1262 * Drivers can use this function to shut down the vblank interrupt handling when 1261 * Drivers can use this function to shut down the vblank interrupt handling when
1263 * disabling a crtc. This function ensures that the latest vblank frame count is 1262 * disabling a crtc. This function ensures that the latest vblank frame count is
1264 * stored so that drm_vblank_on() can restore it again. 1263 * stored so that drm_vblank_on can restore it again.
1265 * 1264 *
1266 * Drivers must use this function when the hardware vblank counter can get 1265 * Drivers must use this function when the hardware vblank counter can get
1267 * reset, e.g. when suspending. 1266 * reset, e.g. when suspending.
1268 *
1269 * This is the legacy version of drm_crtc_vblank_off().
1270 */ 1267 */
1271void drm_vblank_off(struct drm_device *dev, unsigned int pipe) 1268void drm_crtc_vblank_off(struct drm_crtc *crtc)
1272{ 1269{
1270 struct drm_device *dev = crtc->dev;
1271 unsigned int pipe = drm_crtc_index(crtc);
1273 struct drm_vblank_crtc *vblank = &dev->vblank[pipe]; 1272 struct drm_vblank_crtc *vblank = &dev->vblank[pipe];
1274 struct drm_pending_vblank_event *e, *t; 1273 struct drm_pending_vblank_event *e, *t;
1275 struct timeval now; 1274 struct timeval now;
@@ -1285,7 +1284,8 @@ void drm_vblank_off(struct drm_device *dev, unsigned int pipe)
1285 DRM_DEBUG_VBL("crtc %d, vblank enabled %d, inmodeset %d\n", 1284 DRM_DEBUG_VBL("crtc %d, vblank enabled %d, inmodeset %d\n",
1286 pipe, vblank->enabled, vblank->inmodeset); 1285 pipe, vblank->enabled, vblank->inmodeset);
1287 1286
1288 /* Avoid redundant vblank disables without previous drm_vblank_on(). */ 1287 /* Avoid redundant vblank disables without previous
1288 * drm_crtc_vblank_on(). */
1289 if (drm_core_check_feature(dev, DRIVER_ATOMIC) || !vblank->inmodeset) 1289 if (drm_core_check_feature(dev, DRIVER_ATOMIC) || !vblank->inmodeset)
1290 vblank_disable_and_save(dev, pipe); 1290 vblank_disable_and_save(dev, pipe);
1291 1291
@@ -1316,25 +1316,6 @@ void drm_vblank_off(struct drm_device *dev, unsigned int pipe)
1316 } 1316 }
1317 spin_unlock_irqrestore(&dev->event_lock, irqflags); 1317 spin_unlock_irqrestore(&dev->event_lock, irqflags);
1318} 1318}
1319EXPORT_SYMBOL(drm_vblank_off);
1320
1321/**
1322 * drm_crtc_vblank_off - disable vblank events on a CRTC
1323 * @crtc: CRTC in question
1324 *
1325 * Drivers can use this function to shut down the vblank interrupt handling when
1326 * disabling a crtc. This function ensures that the latest vblank frame count is
1327 * stored so that drm_vblank_on can restore it again.
1328 *
1329 * Drivers must use this function when the hardware vblank counter can get
1330 * reset, e.g. when suspending.
1331 *
1332 * This is the native kms version of drm_vblank_off().
1333 */
1334void drm_crtc_vblank_off(struct drm_crtc *crtc)
1335{
1336 drm_vblank_off(crtc->dev, drm_crtc_index(crtc));
1337}
1338EXPORT_SYMBOL(drm_crtc_vblank_off); 1319EXPORT_SYMBOL(drm_crtc_vblank_off);
1339 1320
1340/** 1321/**
@@ -1370,19 +1351,18 @@ void drm_crtc_vblank_reset(struct drm_crtc *crtc)
1370EXPORT_SYMBOL(drm_crtc_vblank_reset); 1351EXPORT_SYMBOL(drm_crtc_vblank_reset);
1371 1352
1372/** 1353/**
1373 * drm_vblank_on - enable vblank events on a CRTC 1354 * drm_crtc_vblank_on - enable vblank events on a CRTC
1374 * @dev: DRM device 1355 * @crtc: CRTC in question
1375 * @pipe: CRTC index
1376 * 1356 *
1377 * This functions restores the vblank interrupt state captured with 1357 * This functions restores the vblank interrupt state captured with
1378 * drm_vblank_off() again. Note that calls to drm_vblank_on() and 1358 * drm_crtc_vblank_off() again. Note that calls to drm_crtc_vblank_on() and
1379 * drm_vblank_off() can be unbalanced and so can also be unconditionally called 1359 * drm_crtc_vblank_off() can be unbalanced and so can also be unconditionally called
1380 * in driver load code to reflect the current hardware state of the crtc. 1360 * in driver load code to reflect the current hardware state of the crtc.
1381 *
1382 * This is the legacy version of drm_crtc_vblank_on().
1383 */ 1361 */
1384void drm_vblank_on(struct drm_device *dev, unsigned int pipe) 1362void drm_crtc_vblank_on(struct drm_crtc *crtc)
1385{ 1363{
1364 struct drm_device *dev = crtc->dev;
1365 unsigned int pipe = drm_crtc_index(crtc);
1386 struct drm_vblank_crtc *vblank = &dev->vblank[pipe]; 1366 struct drm_vblank_crtc *vblank = &dev->vblank[pipe];
1387 unsigned long irqflags; 1367 unsigned long irqflags;
1388 1368
@@ -1409,23 +1389,6 @@ void drm_vblank_on(struct drm_device *dev, unsigned int pipe)
1409 WARN_ON(drm_vblank_enable(dev, pipe)); 1389 WARN_ON(drm_vblank_enable(dev, pipe));
1410 spin_unlock_irqrestore(&dev->vbl_lock, irqflags); 1390 spin_unlock_irqrestore(&dev->vbl_lock, irqflags);
1411} 1391}
1412EXPORT_SYMBOL(drm_vblank_on);
1413
1414/**
1415 * drm_crtc_vblank_on - enable vblank events on a CRTC
1416 * @crtc: CRTC in question
1417 *
1418 * This functions restores the vblank interrupt state captured with
1419 * drm_vblank_off() again. Note that calls to drm_vblank_on() and
1420 * drm_vblank_off() can be unbalanced and so can also be unconditionally called
1421 * in driver load code to reflect the current hardware state of the crtc.
1422 *
1423 * This is the native kms version of drm_vblank_on().
1424 */
1425void drm_crtc_vblank_on(struct drm_crtc *crtc)
1426{
1427 drm_vblank_on(crtc->dev, drm_crtc_index(crtc));
1428}
1429EXPORT_SYMBOL(drm_crtc_vblank_on); 1392EXPORT_SYMBOL(drm_crtc_vblank_on);
1430 1393
1431static void drm_legacy_vblank_pre_modeset(struct drm_device *dev, 1394static void drm_legacy_vblank_pre_modeset(struct drm_device *dev,
@@ -1548,11 +1511,10 @@ static int drm_queue_vblank_event(struct drm_device *dev, unsigned int pipe,
1548 spin_lock_irqsave(&dev->event_lock, flags); 1511 spin_lock_irqsave(&dev->event_lock, flags);
1549 1512
1550 /* 1513 /*
1551 * drm_vblank_off() might have been called after we called 1514 * drm_crtc_vblank_off() might have been called after we called
1552 * drm_vblank_get(). drm_vblank_off() holds event_lock 1515 * drm_vblank_get(). drm_crtc_vblank_off() holds event_lock around the
1553 * around the vblank disable, so no need for further locking. 1516 * vblank disable, so no need for further locking. The reference from
1554 * The reference from drm_vblank_get() protects against 1517 * drm_vblank_get() protects against vblank disable from another source.
1555 * vblank disable from another source.
1556 */ 1518 */
1557 if (!vblank->enabled) { 1519 if (!vblank->enabled) {
1558 ret = -EINVAL; 1520 ret = -EINVAL;