Line
Link Here
|
|
-- |
|
|
1 |
drivers/gpu/drm/i915/intel_fbdev.c | 20 +++++++++++++------- |
|
drivers/gpu/drm/i915/intel_fbdev.c | 20 +++++++++++++------- |
2 |
1 file changed, 13 insertions(+), 7 deletions(-) |
1 |
1 file changed, 13 insertions(+), 7 deletions(-) |
3 |
-- a/drivers/gpu/drm/i915/intel_fbdev.c |
2 |
++ b/drivers/gpu/drm/i915/intel_fbdev.c |
Lines 163-175
static int intelfb_alloc(struct drm_fb_h
Link Here
|
163 |
goto out; |
163 |
goto out; |
164 |
} |
164 |
} |
165 |
|
165 |
|
166 |
/* Flush everything out, we'll be doing GTT only from now on */ |
|
|
167 |
ret = intel_pin_and_fence_fb_obj(NULL, fb, NULL, NULL, NULL); |
168 |
if (ret) { |
169 |
DRM_ERROR("failed to pin obj: %d\n", ret); |
170 |
goto out; |
171 |
} |
172 |
|
173 |
mutex_unlock(&dev->struct_mutex); |
166 |
mutex_unlock(&dev->struct_mutex); |
174 |
|
167 |
|
175 |
ifbdev->fb = to_intel_framebuffer(fb); |
168 |
ifbdev->fb = to_intel_framebuffer(fb); |
Lines 225-230
static int intelfb_create(struct drm_fb_
Link Here
|
225 |
|
218 |
|
226 |
mutex_lock(&dev->struct_mutex); |
219 |
mutex_lock(&dev->struct_mutex); |
227 |
|
220 |
|
|
|
221 |
/* Pin the GGTT vma for our access via info->screen_base. |
222 |
* This also validates that any existing fb inherited from the |
223 |
* BIOS is suitable for own access. |
224 |
*/ |
225 |
ret = intel_pin_and_fence_fb_obj(NULL, &ifbdev->fb->base, NULL, NULL, NULL); |
226 |
if (ret) |
227 |
goto out_unlock; |
228 |
|
228 |
info = drm_fb_helper_alloc_fbi(helper); |
229 |
info = drm_fb_helper_alloc_fbi(helper); |
229 |
if (IS_ERR(info)) { |
230 |
if (IS_ERR(info)) { |
230 |
ret = PTR_ERR(info); |
231 |
ret = PTR_ERR(info); |
Lines 286-291
out_destroy_fbi:
Link Here
|
286 |
out_unpin: |
287 |
out_unpin: |
287 |
i915_gem_object_ggtt_unpin(obj); |
288 |
i915_gem_object_ggtt_unpin(obj); |
288 |
drm_gem_object_unreference(&obj->base); |
289 |
drm_gem_object_unreference(&obj->base); |
|
|
290 |
out_unlock: |
289 |
mutex_unlock(&dev->struct_mutex); |
291 |
mutex_unlock(&dev->struct_mutex); |
290 |
return ret; |
292 |
return ret; |
291 |
} |
293 |
} |
Lines 523-528
static const struct drm_fb_helper_funcs
Link Here
|
523 |
static void intel_fbdev_destroy(struct drm_device *dev, |
525 |
static void intel_fbdev_destroy(struct drm_device *dev, |
524 |
struct intel_fbdev *ifbdev) |
526 |
struct intel_fbdev *ifbdev) |
525 |
{ |
527 |
{ |
|
|
528 |
/* We rely on the object-free to release the VMA pinning for |
529 |
* the info->screen_base mmaping. Leaking the VMA is simpler than |
530 |
* trying to rectify all the possible error paths leading here. |
531 |
*/ |
526 |
|
532 |
|
527 |
drm_fb_helper_unregister_fbi(&ifbdev->helper); |
533 |
drm_fb_helper_unregister_fbi(&ifbdev->helper); |
528 |
drm_fb_helper_release_fbi(&ifbdev->helper); |
534 |
drm_fb_helper_release_fbi(&ifbdev->helper); |