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

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'drm-fixes-for-v4.17-rc4' of git://people.freedesktop.org/~airlied/linux

Pull drm fixes from Dave Airlie:
"vmwgfx, i915, vc4, vga dac fixes.

This seems eerily quiet, so I expect it will explode next week or
something.

One i915 model firmware, two vmwgfx fixes, one vc4 fix and one bridge
leak fix"

* tag 'drm-fixes-for-v4.17-rc4' of git://people.freedesktop.org/~airlied/linux:
drm/bridge: vga-dac: Fix edid memory leak
drm/vc4: Make sure vc4_bo_{inc,dec}_usecnt() calls are balanced
drm/i915/glk: Add MODULE_FIRMWARE for Geminilake
drm/vmwgfx: Fix a buffer object leak
drm/vmwgfx: Clean up fbdev modeset locking

+70 -26
+3 -1
drivers/gpu/drm/bridge/dumb-vga-dac.c
··· 56 56 } 57 57 58 58 drm_mode_connector_update_edid_property(connector, edid); 59 - return drm_add_edid_modes(connector, edid); 59 + ret = drm_add_edid_modes(connector, edid); 60 + kfree(edid); 61 + return ret; 60 62 61 63 fallback: 62 64 /*
+1
drivers/gpu/drm/i915/intel_csr.c
··· 35 35 */ 36 36 37 37 #define I915_CSR_GLK "i915/glk_dmc_ver1_04.bin" 38 + MODULE_FIRMWARE(I915_CSR_GLK); 38 39 #define GLK_CSR_VERSION_REQUIRED CSR_VERSION(1, 4) 39 40 40 41 #define I915_CSR_CNL "i915/cnl_dmc_ver1_07.bin"
+45 -1
drivers/gpu/drm/vc4/vc4_crtc.c
··· 760 760 struct vc4_async_flip_state { 761 761 struct drm_crtc *crtc; 762 762 struct drm_framebuffer *fb; 763 + struct drm_framebuffer *old_fb; 763 764 struct drm_pending_vblank_event *event; 764 765 765 766 struct vc4_seqno_cb cb; ··· 790 789 791 790 drm_crtc_vblank_put(crtc); 792 791 drm_framebuffer_put(flip_state->fb); 792 + 793 + /* Decrement the BO usecnt in order to keep the inc/dec calls balanced 794 + * when the planes are updated through the async update path. 795 + * FIXME: we should move to generic async-page-flip when it's 796 + * available, so that we can get rid of this hand-made cleanup_fb() 797 + * logic. 798 + */ 799 + if (flip_state->old_fb) { 800 + struct drm_gem_cma_object *cma_bo; 801 + struct vc4_bo *bo; 802 + 803 + cma_bo = drm_fb_cma_get_gem_obj(flip_state->old_fb, 0); 804 + bo = to_vc4_bo(&cma_bo->base); 805 + vc4_bo_dec_usecnt(bo); 806 + drm_framebuffer_put(flip_state->old_fb); 807 + } 808 + 793 809 kfree(flip_state); 794 810 795 811 up(&vc4->async_modeset); ··· 831 813 struct drm_gem_cma_object *cma_bo = drm_fb_cma_get_gem_obj(fb, 0); 832 814 struct vc4_bo *bo = to_vc4_bo(&cma_bo->base); 833 815 816 + /* Increment the BO usecnt here, so that we never end up with an 817 + * unbalanced number of vc4_bo_{dec,inc}_usecnt() calls when the 818 + * plane is later updated through the non-async path. 819 + * FIXME: we should move to generic async-page-flip when it's 820 + * available, so that we can get rid of this hand-made prepare_fb() 821 + * logic. 822 + */ 823 + ret = vc4_bo_inc_usecnt(bo); 824 + if (ret) 825 + return ret; 826 + 834 827 flip_state = kzalloc(sizeof(*flip_state), GFP_KERNEL); 835 - if (!flip_state) 828 + if (!flip_state) { 829 + vc4_bo_dec_usecnt(bo); 836 830 return -ENOMEM; 831 + } 837 832 838 833 drm_framebuffer_get(fb); 839 834 flip_state->fb = fb; ··· 857 826 ret = down_interruptible(&vc4->async_modeset); 858 827 if (ret) { 859 828 drm_framebuffer_put(fb); 829 + vc4_bo_dec_usecnt(bo); 860 830 kfree(flip_state); 861 831 return ret; 862 832 } 833 + 834 + /* Save the current FB before it's replaced by the new one in 835 + * drm_atomic_set_fb_for_plane(). We'll need the old FB in 836 + * vc4_async_page_flip_complete() to decrement the BO usecnt and keep 837 + * it consistent. 838 + * FIXME: we should move to generic async-page-flip when it's 839 + * available, so that we can get rid of this hand-made cleanup_fb() 840 + * logic. 841 + */ 842 + flip_state->old_fb = plane->state->fb; 843 + if (flip_state->old_fb) 844 + drm_framebuffer_get(flip_state->old_fb); 863 845 864 846 WARN_ON(drm_crtc_vblank_get(crtc) != 0); 865 847
+10 -21
drivers/gpu/drm/vmwgfx/vmwgfx_fb.c
··· 441 441 struct drm_crtc *crtc = set->crtc; 442 442 struct drm_framebuffer *fb; 443 443 struct drm_crtc *tmp; 444 - struct drm_modeset_acquire_ctx *ctx; 445 444 struct drm_device *dev = set->crtc->dev; 445 + struct drm_modeset_acquire_ctx ctx; 446 446 int ret; 447 447 448 - ctx = dev->mode_config.acquire_ctx; 448 + drm_modeset_acquire_init(&ctx, 0); 449 449 450 450 restart: 451 451 /* ··· 458 458 459 459 fb = set->fb; 460 460 461 - ret = crtc->funcs->set_config(set, ctx); 461 + ret = crtc->funcs->set_config(set, &ctx); 462 462 if (ret == 0) { 463 463 crtc->primary->crtc = crtc; 464 464 crtc->primary->fb = fb; ··· 473 473 } 474 474 475 475 if (ret == -EDEADLK) { 476 - dev->mode_config.acquire_ctx = NULL; 477 - 478 - retry_locking: 479 - drm_modeset_backoff(ctx); 480 - 481 - ret = drm_modeset_lock_all_ctx(dev, ctx); 482 - if (ret) 483 - goto retry_locking; 484 - 485 - dev->mode_config.acquire_ctx = ctx; 486 - 476 + drm_modeset_backoff(&ctx); 487 477 goto restart; 488 478 } 479 + 480 + drm_modeset_drop_locks(&ctx); 481 + drm_modeset_acquire_fini(&ctx); 489 482 490 483 return ret; 491 484 } ··· 617 624 } 618 625 619 626 mutex_lock(&par->bo_mutex); 620 - drm_modeset_lock_all(vmw_priv->dev); 621 627 ret = vmw_fb_kms_framebuffer(info); 622 628 if (ret) 623 629 goto out_unlock; ··· 649 657 drm_mode_destroy(vmw_priv->dev, old_mode); 650 658 par->set_mode = mode; 651 659 652 - drm_modeset_unlock_all(vmw_priv->dev); 653 660 mutex_unlock(&par->bo_mutex); 654 661 655 662 return ret; ··· 704 713 par->max_width = fb_width; 705 714 par->max_height = fb_height; 706 715 707 - drm_modeset_lock_all(vmw_priv->dev); 708 716 ret = vmw_kms_fbdev_init_data(vmw_priv, 0, par->max_width, 709 717 par->max_height, &par->con, 710 718 &par->crtc, &init_mode); 711 - if (ret) { 712 - drm_modeset_unlock_all(vmw_priv->dev); 719 + if (ret) 713 720 goto err_kms; 714 - } 715 721 716 722 info->var.xres = init_mode->hdisplay; 717 723 info->var.yres = init_mode->vdisplay; 718 - drm_modeset_unlock_all(vmw_priv->dev); 719 724 720 725 /* 721 726 * Create buffers and alloc memory ··· 819 832 cancel_delayed_work_sync(&par->local_work); 820 833 unregister_framebuffer(info); 821 834 835 + mutex_lock(&par->bo_mutex); 822 836 (void) vmw_fb_kms_detach(par, true, true); 837 + mutex_unlock(&par->bo_mutex); 823 838 824 839 vfree(par->vmalloc); 825 840 framebuffer_release(info);
+11 -3
drivers/gpu/drm/vmwgfx/vmwgfx_kms.c
··· 2595 2595 vmw_kms_helper_buffer_finish(res->dev_priv, NULL, ctx->buf, 2596 2596 out_fence, NULL); 2597 2597 2598 + vmw_dmabuf_unreference(&ctx->buf); 2598 2599 vmw_resource_unreserve(res, false, NULL, 0); 2599 2600 mutex_unlock(&res->dev_priv->cmdbuf_mutex); 2600 2601 } ··· 2681 2680 struct vmw_display_unit *du; 2682 2681 struct drm_display_mode *mode; 2683 2682 int i = 0; 2683 + int ret = 0; 2684 2684 2685 + mutex_lock(&dev_priv->dev->mode_config.mutex); 2685 2686 list_for_each_entry(con, &dev_priv->dev->mode_config.connector_list, 2686 2687 head) { 2687 2688 if (i == unit) ··· 2694 2691 2695 2692 if (i != unit) { 2696 2693 DRM_ERROR("Could not find initial display unit.\n"); 2697 - return -EINVAL; 2694 + ret = -EINVAL; 2695 + goto out_unlock; 2698 2696 } 2699 2697 2700 2698 if (list_empty(&con->modes)) ··· 2703 2699 2704 2700 if (list_empty(&con->modes)) { 2705 2701 DRM_ERROR("Could not find initial display mode.\n"); 2706 - return -EINVAL; 2702 + ret = -EINVAL; 2703 + goto out_unlock; 2707 2704 } 2708 2705 2709 2706 du = vmw_connector_to_du(con); ··· 2725 2720 head); 2726 2721 } 2727 2722 2728 - return 0; 2723 + out_unlock: 2724 + mutex_unlock(&dev_priv->dev->mode_config.mutex); 2725 + 2726 + return ret; 2729 2727 } 2730 2728 2731 2729 /**