diff options
-rw-r--r-- | drivers/gpu/drm/i915/intel_display.c | 14 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/intel_drv.h | 1 |
2 files changed, 8 insertions, 7 deletions
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index a25ff006fdb0..86cbc771bce6 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c | |||
@@ -2371,7 +2371,7 @@ intel_alloc_plane_obj(struct intel_crtc *crtc, | |||
2371 | struct drm_device *dev = crtc->base.dev; | 2371 | struct drm_device *dev = crtc->base.dev; |
2372 | struct drm_i915_gem_object *obj = NULL; | 2372 | struct drm_i915_gem_object *obj = NULL; |
2373 | struct drm_mode_fb_cmd2 mode_cmd = { 0 }; | 2373 | struct drm_mode_fb_cmd2 mode_cmd = { 0 }; |
2374 | struct drm_framebuffer *fb = crtc->base.primary->fb; | 2374 | struct drm_framebuffer *fb = &plane_config->fb->base; |
2375 | u32 base = plane_config->base; | 2375 | u32 base = plane_config->base; |
2376 | 2376 | ||
2377 | if (plane_config->size == 0) | 2377 | if (plane_config->size == 0) |
@@ -2435,16 +2435,16 @@ intel_find_plane_obj(struct intel_crtc *intel_crtc, | |||
2435 | struct intel_crtc *i; | 2435 | struct intel_crtc *i; |
2436 | struct drm_i915_gem_object *obj; | 2436 | struct drm_i915_gem_object *obj; |
2437 | 2437 | ||
2438 | if (!intel_crtc->base.primary->fb) | 2438 | if (!plane_config->fb) |
2439 | return; | 2439 | return; |
2440 | 2440 | ||
2441 | if (intel_alloc_plane_obj(intel_crtc, plane_config)) { | 2441 | if (intel_alloc_plane_obj(intel_crtc, plane_config)) { |
2442 | intel_crtc->base.primary->fb = &plane_config->fb->base; | ||
2442 | update_state_fb(intel_crtc->base.primary); | 2443 | update_state_fb(intel_crtc->base.primary); |
2443 | return; | 2444 | return; |
2444 | } | 2445 | } |
2445 | 2446 | ||
2446 | kfree(intel_crtc->base.primary->fb); | 2447 | kfree(plane_config->fb); |
2447 | intel_crtc->base.primary->fb = NULL; | ||
2448 | 2448 | ||
2449 | /* | 2449 | /* |
2450 | * Failed to alloc the obj, check to see if we should share | 2450 | * Failed to alloc the obj, check to see if we should share |
@@ -6653,7 +6653,7 @@ i9xx_get_initial_plane_config(struct intel_crtc *crtc, | |||
6653 | fb->bits_per_pixel, base, fb->pitches[0], | 6653 | fb->bits_per_pixel, base, fb->pitches[0], |
6654 | plane_config->size); | 6654 | plane_config->size); |
6655 | 6655 | ||
6656 | crtc->base.primary->fb = fb; | 6656 | plane_config->fb = intel_fb; |
6657 | } | 6657 | } |
6658 | 6658 | ||
6659 | static void chv_crtc_clock_get(struct intel_crtc *crtc, | 6659 | static void chv_crtc_clock_get(struct intel_crtc *crtc, |
@@ -7690,7 +7690,7 @@ skylake_get_initial_plane_config(struct intel_crtc *crtc, | |||
7690 | fb->bits_per_pixel, base, fb->pitches[0], | 7690 | fb->bits_per_pixel, base, fb->pitches[0], |
7691 | plane_config->size); | 7691 | plane_config->size); |
7692 | 7692 | ||
7693 | crtc->base.primary->fb = fb; | 7693 | plane_config->fb = intel_fb; |
7694 | return; | 7694 | return; |
7695 | 7695 | ||
7696 | error: | 7696 | error: |
@@ -7781,7 +7781,7 @@ ironlake_get_initial_plane_config(struct intel_crtc *crtc, | |||
7781 | fb->bits_per_pixel, base, fb->pitches[0], | 7781 | fb->bits_per_pixel, base, fb->pitches[0], |
7782 | plane_config->size); | 7782 | plane_config->size); |
7783 | 7783 | ||
7784 | crtc->base.primary->fb = fb; | 7784 | plane_config->fb = intel_fb; |
7785 | } | 7785 | } |
7786 | 7786 | ||
7787 | static bool ironlake_get_pipe_config(struct intel_crtc *crtc, | 7787 | static bool ironlake_get_pipe_config(struct intel_crtc *crtc, |
diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h index f048f8bb8beb..76b3c2043954 100644 --- a/drivers/gpu/drm/i915/intel_drv.h +++ b/drivers/gpu/drm/i915/intel_drv.h | |||
@@ -258,6 +258,7 @@ struct intel_plane_state { | |||
258 | }; | 258 | }; |
259 | 259 | ||
260 | struct intel_initial_plane_config { | 260 | struct intel_initial_plane_config { |
261 | struct intel_framebuffer *fb; | ||
261 | unsigned int tiling; | 262 | unsigned int tiling; |
262 | int size; | 263 | int size; |
263 | u32 base; | 264 | u32 base; |