aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/gma500
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2014-01-28 18:35:48 -0500
committerDave Airlie <airlied@redhat.com>2014-01-28 18:35:48 -0500
commit5a0abe30bebae3e73bf7808f55b2cd0309fa101d (patch)
tree34ca0a1ac75ef8abd0ec774cfadab60a3c9a387d /drivers/gpu/drm/gma500
parent76f4f415e502e4dfaf409edd0d4ed0dd3a0a0419 (diff)
parent631794b44bd3dbfba37074954d5c584c9e8725f0 (diff)
Merge branch 'gma500-next' of git://github.com/patjak/drm-gma500 into drm-next
Only two patches this time around. One trivial and one locking fix. * 'gma500-next' of git://github.com/patjak/drm-gma500: drm/gma500: Lock struct_mutex around cursor updates drivers: gpu: Mark function as static in cdv_intel_dp.c
Diffstat (limited to 'drivers/gpu/drm/gma500')
-rw-r--r--drivers/gpu/drm/gma500/cdv_intel_dp.c2
-rw-r--r--drivers/gpu/drm/gma500/gma_display.c12
2 files changed, 11 insertions, 3 deletions
diff --git a/drivers/gpu/drm/gma500/cdv_intel_dp.c b/drivers/gpu/drm/gma500/cdv_intel_dp.c
index 6a7c2481d4ab..0490ce36b53f 100644
--- a/drivers/gpu/drm/gma500/cdv_intel_dp.c
+++ b/drivers/gpu/drm/gma500/cdv_intel_dp.c
@@ -678,7 +678,7 @@ cdv_intel_dp_i2c_init(struct gma_connector *connector,
678 return ret; 678 return ret;
679} 679}
680 680
681void cdv_intel_fixed_panel_mode(struct drm_display_mode *fixed_mode, 681static void cdv_intel_fixed_panel_mode(struct drm_display_mode *fixed_mode,
682 struct drm_display_mode *adjusted_mode) 682 struct drm_display_mode *adjusted_mode)
683{ 683{
684 adjusted_mode->hdisplay = fixed_mode->hdisplay; 684 adjusted_mode->hdisplay = fixed_mode->hdisplay;
diff --git a/drivers/gpu/drm/gma500/gma_display.c b/drivers/gpu/drm/gma500/gma_display.c
index 24e8af3d22bf..386de2c9dc86 100644
--- a/drivers/gpu/drm/gma500/gma_display.c
+++ b/drivers/gpu/drm/gma500/gma_display.c
@@ -349,6 +349,7 @@ int gma_crtc_cursor_set(struct drm_crtc *crtc,
349 /* If we didn't get a handle then turn the cursor off */ 349 /* If we didn't get a handle then turn the cursor off */
350 if (!handle) { 350 if (!handle) {
351 temp = CURSOR_MODE_DISABLE; 351 temp = CURSOR_MODE_DISABLE;
352 mutex_lock(&dev->struct_mutex);
352 353
353 if (gma_power_begin(dev, false)) { 354 if (gma_power_begin(dev, false)) {
354 REG_WRITE(control, temp); 355 REG_WRITE(control, temp);
@@ -365,6 +366,7 @@ int gma_crtc_cursor_set(struct drm_crtc *crtc,
365 gma_crtc->cursor_obj = NULL; 366 gma_crtc->cursor_obj = NULL;
366 } 367 }
367 368
369 mutex_unlock(&dev->struct_mutex);
368 return 0; 370 return 0;
369 } 371 }
370 372
@@ -374,9 +376,12 @@ int gma_crtc_cursor_set(struct drm_crtc *crtc,
374 return -EINVAL; 376 return -EINVAL;
375 } 377 }
376 378
379 mutex_lock(&dev->struct_mutex);
377 obj = drm_gem_object_lookup(dev, file_priv, handle); 380 obj = drm_gem_object_lookup(dev, file_priv, handle);
378 if (!obj) 381 if (!obj) {
379 return -ENOENT; 382 ret = -ENOENT;
383 goto unlock;
384 }
380 385
381 if (obj->size < width * height * 4) { 386 if (obj->size < width * height * 4) {
382 dev_dbg(dev->dev, "Buffer is too small\n"); 387 dev_dbg(dev->dev, "Buffer is too small\n");
@@ -440,10 +445,13 @@ int gma_crtc_cursor_set(struct drm_crtc *crtc,
440 } 445 }
441 446
442 gma_crtc->cursor_obj = obj; 447 gma_crtc->cursor_obj = obj;
448unlock:
449 mutex_unlock(&dev->struct_mutex);
443 return ret; 450 return ret;
444 451
445unref_cursor: 452unref_cursor:
446 drm_gem_object_unreference(obj); 453 drm_gem_object_unreference(obj);
454 mutex_unlock(&dev->struct_mutex);
447 return ret; 455 return ret;
448} 456}
449 457