From a4ab86bc78f354eb782af5dc3c5f4177c7f64ed1 Mon Sep 17 00:00:00 2001 From: Rashika Kheria Date: Mon, 6 Jan 2014 20:32:47 +0530 Subject: [PATCH 1/2] drivers: gpu: Mark function as static in cdv_intel_dp.c MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Mark function cdv_intel_fixed_panel_mode() as static in drm/gma500/cdv_intel_dp.c because it is not used outside this file. This eliminates the following warning in drm/gma500/cdv_intel_dp.c: drivers/gpu/drm/gma500/cdv_intel_dp.c:680:6: warning: no previous prototype for ‘cdv_intel_fixed_panel_mode’ [-Wmissing-prototypes] Signed-off-by: Rashika Kheria Reviewed-by: Josh Triplett Signed-off-by: Patrik Jakobsson --- drivers/gpu/drm/gma500/cdv_intel_dp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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, return ret; } -void cdv_intel_fixed_panel_mode(struct drm_display_mode *fixed_mode, +static void cdv_intel_fixed_panel_mode(struct drm_display_mode *fixed_mode, struct drm_display_mode *adjusted_mode) { adjusted_mode->hdisplay = fixed_mode->hdisplay; From 631794b44bd3dbfba37074954d5c584c9e8725f0 Mon Sep 17 00:00:00 2001 From: Patrik Jakobsson Date: Wed, 8 Jan 2014 19:30:40 +0100 Subject: [PATCH 2/2] drm/gma500: Lock struct_mutex around cursor updates Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=64361 Cc: Signed-off-by: Patrik Jakobsson --- drivers/gpu/drm/gma500/gma_display.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) 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, /* If we didn't get a handle then turn the cursor off */ if (!handle) { temp = CURSOR_MODE_DISABLE; + mutex_lock(&dev->struct_mutex); if (gma_power_begin(dev, false)) { REG_WRITE(control, temp); @@ -365,6 +366,7 @@ int gma_crtc_cursor_set(struct drm_crtc *crtc, gma_crtc->cursor_obj = NULL; } + mutex_unlock(&dev->struct_mutex); return 0; } @@ -374,9 +376,12 @@ int gma_crtc_cursor_set(struct drm_crtc *crtc, return -EINVAL; } + mutex_lock(&dev->struct_mutex); obj = drm_gem_object_lookup(dev, file_priv, handle); - if (!obj) - return -ENOENT; + if (!obj) { + ret = -ENOENT; + goto unlock; + } if (obj->size < width * height * 4) { dev_dbg(dev->dev, "Buffer is too small\n"); @@ -440,10 +445,13 @@ int gma_crtc_cursor_set(struct drm_crtc *crtc, } gma_crtc->cursor_obj = obj; +unlock: + mutex_unlock(&dev->struct_mutex); return ret; unref_cursor: drm_gem_object_unreference(obj); + mutex_unlock(&dev->struct_mutex); return ret; }