Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 217989
b: refs/heads/master
c: 7e7d76c
h: refs/heads/master
i:
  217987: cc7aac0
v: v3
  • Loading branch information
Jesse Barnes authored and Chris Wilson committed Sep 10, 2010
1 parent c3e17d9 commit 375f444
Show file tree
Hide file tree
Showing 2 changed files with 61 additions and 10 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 4d12fe0b4864682d3562021cde0f32961c655d75
refs/heads/master: 7e7d76c306adb73a41d2678a42a11004df2519b7
69 changes: 60 additions & 9 deletions trunk/drivers/gpu/drm/i915/intel_display.c
Original file line number Diff line number Diff line change
Expand Up @@ -2478,16 +2478,60 @@ static void intel_crtc_dpms(struct drm_crtc *crtc, int mode)
}
}

static void intel_crtc_prepare (struct drm_crtc *crtc)
/* Prepare for a mode set.
*
* Note we could be a lot smarter here. We need to figure out which outputs
* will be enabled, which disabled (in short, how the config will changes)
* and perform the minimum necessary steps to accomplish that, e.g. updating
* watermarks, FBC configuration, making sure PLLs are programmed correctly,
* panel fitting is in the proper state, etc.
*/
static void i9xx_crtc_prepare(struct drm_crtc *crtc)
{
struct drm_crtc_helper_funcs *crtc_funcs = crtc->helper_private;
crtc_funcs->dpms(crtc, DRM_MODE_DPMS_OFF);
struct drm_device *dev = crtc->dev;
struct intel_crtc *intel_crtc = to_intel_crtc(crtc);

intel_crtc->cursor_on = false;
intel_crtc_update_cursor(crtc);

i9xx_crtc_disable(crtc);
intel_clear_scanline_wait(dev);
}

static void intel_crtc_commit (struct drm_crtc *crtc)
static void i9xx_crtc_commit(struct drm_crtc *crtc)
{
struct drm_crtc_helper_funcs *crtc_funcs = crtc->helper_private;
crtc_funcs->dpms(crtc, DRM_MODE_DPMS_ON);
struct drm_device *dev = crtc->dev;
struct intel_crtc *intel_crtc = to_intel_crtc(crtc);

intel_update_watermarks(dev);
i9xx_crtc_enable(crtc);

intel_crtc->cursor_on = true;
intel_crtc_update_cursor(crtc);
}

static void ironlake_crtc_prepare(struct drm_crtc *crtc)
{
struct drm_device *dev = crtc->dev;
struct intel_crtc *intel_crtc = to_intel_crtc(crtc);

intel_crtc->cursor_on = false;
intel_crtc_update_cursor(crtc);

ironlake_crtc_disable(crtc);
intel_clear_scanline_wait(dev);
}

static void ironlake_crtc_commit(struct drm_crtc *crtc)
{
struct drm_device *dev = crtc->dev;
struct intel_crtc *intel_crtc = to_intel_crtc(crtc);

intel_update_watermarks(dev);
ironlake_crtc_enable(crtc);

intel_crtc->cursor_on = true;
intel_crtc_update_cursor(crtc);
}

void intel_encoder_prepare (struct drm_encoder *encoder)
Expand Down Expand Up @@ -5184,14 +5228,12 @@ static int intel_crtc_page_flip(struct drm_crtc *crtc,
return ret;
}

static const struct drm_crtc_helper_funcs intel_helper_funcs = {
static struct drm_crtc_helper_funcs intel_helper_funcs = {
.dpms = intel_crtc_dpms,
.mode_fixup = intel_crtc_mode_fixup,
.mode_set = intel_crtc_mode_set,
.mode_set_base = intel_pipe_set_base,
.mode_set_base_atomic = intel_pipe_set_base_atomic,
.prepare = intel_crtc_prepare,
.commit = intel_crtc_commit,
.load_lut = intel_crtc_load_lut,
};

Expand Down Expand Up @@ -5241,6 +5283,15 @@ static void intel_crtc_init(struct drm_device *dev, int pipe)

intel_crtc->cursor_addr = 0;
intel_crtc->dpms_mode = -1;

if (HAS_PCH_SPLIT(dev)) {
intel_helper_funcs.prepare = ironlake_crtc_prepare;
intel_helper_funcs.commit = ironlake_crtc_commit;
} else {
intel_helper_funcs.prepare = i9xx_crtc_prepare;
intel_helper_funcs.commit = i9xx_crtc_commit;
}

drm_crtc_helper_add(&intel_crtc->base, &intel_helper_funcs);

intel_crtc->busy = false;
Expand Down

0 comments on commit 375f444

Please sign in to comment.