summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorDamien Lespiau <damien.lespiau@intel.com>2015-02-05 17:22:18 +0000
committerDaniel Vetter <daniel.vetter@ffwll.ch>2015-02-13 23:28:05 +0100
commit2d14030b1a9d0e89cfdca6f16851e2eac8cb4de0 (patch)
tree084affc32bee1f5116250bac3599c9187224b04d /drivers
parentf55548b5af87ebfc586ca75748947f1c1b1a4a52 (diff)
downloadlinux-2d14030b1a9d0e89cfdca6f16851e2eac8cb4de0.tar.gz
linux-2d14030b1a9d0e89cfdca6f16851e2eac8cb4de0.tar.bz2
linux-2d14030b1a9d0e89cfdca6f16851e2eac8cb4de0.zip
drm/i915: Store the initial framebuffer in initial_plane_config
At the moment we use crtc->base.primary->fb to hold the initial framebuffer allocation, disregarding if it's valid or not. This lead to believe we were actually updating the fb at this point, but it's not true and we haven't even called drm_framebuffer_init() on this fb. Instead, let's store the state in struct intel_initial_plane_config until we know we can reuse that framebuffer. Signed-off-by: Damien Lespiau <damien.lespiau@intel.com> Reviewed-by: Matt Roper <matthew.d.roper@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/gpu/drm/i915/intel_display.c14
-rw-r--r--drivers/gpu/drm/i915/intel_drv.h1
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,
struct drm_device *dev = crtc->base.dev;
struct drm_i915_gem_object *obj = NULL;
struct drm_mode_fb_cmd2 mode_cmd = { 0 };
- struct drm_framebuffer *fb = crtc->base.primary->fb;
+ struct drm_framebuffer *fb = &plane_config->fb->base;
u32 base = plane_config->base;
if (plane_config->size == 0)
@@ -2435,16 +2435,16 @@ intel_find_plane_obj(struct intel_crtc *intel_crtc,
struct intel_crtc *i;
struct drm_i915_gem_object *obj;
- if (!intel_crtc->base.primary->fb)
+ if (!plane_config->fb)
return;
if (intel_alloc_plane_obj(intel_crtc, plane_config)) {
+ intel_crtc->base.primary->fb = &plane_config->fb->base;
update_state_fb(intel_crtc->base.primary);
return;
}
- kfree(intel_crtc->base.primary->fb);
- intel_crtc->base.primary->fb = NULL;
+ kfree(plane_config->fb);
/*
* 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,
fb->bits_per_pixel, base, fb->pitches[0],
plane_config->size);
- crtc->base.primary->fb = fb;
+ plane_config->fb = intel_fb;
}
static void chv_crtc_clock_get(struct intel_crtc *crtc,
@@ -7690,7 +7690,7 @@ skylake_get_initial_plane_config(struct intel_crtc *crtc,
fb->bits_per_pixel, base, fb->pitches[0],
plane_config->size);
- crtc->base.primary->fb = fb;
+ plane_config->fb = intel_fb;
return;
error:
@@ -7781,7 +7781,7 @@ ironlake_get_initial_plane_config(struct intel_crtc *crtc,
fb->bits_per_pixel, base, fb->pitches[0],
plane_config->size);
- crtc->base.primary->fb = fb;
+ plane_config->fb = intel_fb;
}
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 {
};
struct intel_initial_plane_config {
+ struct intel_framebuffer *fb;
unsigned int tiling;
int size;
u32 base;