Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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

+11 -3
+1 -1
drivers/gpu/drm/gma500/cdv_intel_dp.c
··· 678 678 return ret; 679 679 } 680 680 681 - void cdv_intel_fixed_panel_mode(struct drm_display_mode *fixed_mode, 681 + static void cdv_intel_fixed_panel_mode(struct drm_display_mode *fixed_mode, 682 682 struct drm_display_mode *adjusted_mode) 683 683 { 684 684 adjusted_mode->hdisplay = fixed_mode->hdisplay;
+10 -2
drivers/gpu/drm/gma500/gma_display.c
··· 349 349 /* If we didn't get a handle then turn the cursor off */ 350 350 if (!handle) { 351 351 temp = CURSOR_MODE_DISABLE; 352 + mutex_lock(&dev->struct_mutex); 352 353 353 354 if (gma_power_begin(dev, false)) { 354 355 REG_WRITE(control, temp); ··· 366 365 gma_crtc->cursor_obj = NULL; 367 366 } 368 367 368 + mutex_unlock(&dev->struct_mutex); 369 369 return 0; 370 370 } 371 371 ··· 376 374 return -EINVAL; 377 375 } 378 376 377 + mutex_lock(&dev->struct_mutex); 379 378 obj = drm_gem_object_lookup(dev, file_priv, handle); 380 - if (!obj) 381 - return -ENOENT; 379 + if (!obj) { 380 + ret = -ENOENT; 381 + goto unlock; 382 + } 382 383 383 384 if (obj->size < width * height * 4) { 384 385 dev_dbg(dev->dev, "Buffer is too small\n"); ··· 445 440 } 446 441 447 442 gma_crtc->cursor_obj = obj; 443 + unlock: 444 + mutex_unlock(&dev->struct_mutex); 448 445 return ret; 449 446 450 447 unref_cursor: 451 448 drm_gem_object_unreference(obj); 449 + mutex_unlock(&dev->struct_mutex); 452 450 return ret; 453 451 } 454 452