|
@@ -3220,16 +3220,16 @@ int i9xx_check_plane_surface(struct intel_plane_state *plane_state)
|
|
return 0;
|
|
return 0;
|
|
}
|
|
}
|
|
|
|
|
|
-static void i9xx_update_primary_plane(struct intel_plane *primary,
|
|
|
|
- const struct intel_crtc_state *crtc_state,
|
|
|
|
- const struct intel_plane_state *plane_state)
|
|
|
|
|
|
+static void i9xx_update_plane(struct intel_plane *plane,
|
|
|
|
+ const struct intel_crtc_state *crtc_state,
|
|
|
|
+ const struct intel_plane_state *plane_state)
|
|
{
|
|
{
|
|
- struct drm_i915_private *dev_priv = to_i915(primary->base.dev);
|
|
|
|
|
|
+ struct drm_i915_private *dev_priv = to_i915(plane->base.dev);
|
|
const struct drm_framebuffer *fb = plane_state->base.fb;
|
|
const struct drm_framebuffer *fb = plane_state->base.fb;
|
|
- enum plane plane = primary->plane;
|
|
|
|
|
|
+ enum i9xx_plane_id i9xx_plane = plane->i9xx_plane;
|
|
u32 linear_offset;
|
|
u32 linear_offset;
|
|
u32 dspcntr = plane_state->ctl;
|
|
u32 dspcntr = plane_state->ctl;
|
|
- i915_reg_t reg = DSPCNTR(plane);
|
|
|
|
|
|
+ i915_reg_t reg = DSPCNTR(i9xx_plane);
|
|
int x = plane_state->main.x;
|
|
int x = plane_state->main.x;
|
|
int y = plane_state->main.y;
|
|
int y = plane_state->main.y;
|
|
unsigned long irqflags;
|
|
unsigned long irqflags;
|
|
@@ -3248,34 +3248,34 @@ static void i9xx_update_primary_plane(struct intel_plane *primary,
|
|
/* pipesrc and dspsize control the size that is scaled from,
|
|
/* pipesrc and dspsize control the size that is scaled from,
|
|
* which should always be the user's requested size.
|
|
* which should always be the user's requested size.
|
|
*/
|
|
*/
|
|
- I915_WRITE_FW(DSPSIZE(plane),
|
|
|
|
|
|
+ I915_WRITE_FW(DSPSIZE(i9xx_plane),
|
|
((crtc_state->pipe_src_h - 1) << 16) |
|
|
((crtc_state->pipe_src_h - 1) << 16) |
|
|
(crtc_state->pipe_src_w - 1));
|
|
(crtc_state->pipe_src_w - 1));
|
|
- I915_WRITE_FW(DSPPOS(plane), 0);
|
|
|
|
- } else if (IS_CHERRYVIEW(dev_priv) && plane == PLANE_B) {
|
|
|
|
- I915_WRITE_FW(PRIMSIZE(plane),
|
|
|
|
|
|
+ I915_WRITE_FW(DSPPOS(i9xx_plane), 0);
|
|
|
|
+ } else if (IS_CHERRYVIEW(dev_priv) && i9xx_plane == PLANE_B) {
|
|
|
|
+ I915_WRITE_FW(PRIMSIZE(i9xx_plane),
|
|
((crtc_state->pipe_src_h - 1) << 16) |
|
|
((crtc_state->pipe_src_h - 1) << 16) |
|
|
(crtc_state->pipe_src_w - 1));
|
|
(crtc_state->pipe_src_w - 1));
|
|
- I915_WRITE_FW(PRIMPOS(plane), 0);
|
|
|
|
- I915_WRITE_FW(PRIMCNSTALPHA(plane), 0);
|
|
|
|
|
|
+ I915_WRITE_FW(PRIMPOS(i9xx_plane), 0);
|
|
|
|
+ I915_WRITE_FW(PRIMCNSTALPHA(i9xx_plane), 0);
|
|
}
|
|
}
|
|
|
|
|
|
I915_WRITE_FW(reg, dspcntr);
|
|
I915_WRITE_FW(reg, dspcntr);
|
|
|
|
|
|
- I915_WRITE_FW(DSPSTRIDE(plane), fb->pitches[0]);
|
|
|
|
|
|
+ I915_WRITE_FW(DSPSTRIDE(i9xx_plane), fb->pitches[0]);
|
|
if (IS_HASWELL(dev_priv) || IS_BROADWELL(dev_priv)) {
|
|
if (IS_HASWELL(dev_priv) || IS_BROADWELL(dev_priv)) {
|
|
- I915_WRITE_FW(DSPSURF(plane),
|
|
|
|
|
|
+ I915_WRITE_FW(DSPSURF(i9xx_plane),
|
|
intel_plane_ggtt_offset(plane_state) +
|
|
intel_plane_ggtt_offset(plane_state) +
|
|
dspaddr_offset);
|
|
dspaddr_offset);
|
|
- I915_WRITE_FW(DSPOFFSET(plane), (y << 16) | x);
|
|
|
|
|
|
+ I915_WRITE_FW(DSPOFFSET(i9xx_plane), (y << 16) | x);
|
|
} else if (INTEL_GEN(dev_priv) >= 4) {
|
|
} else if (INTEL_GEN(dev_priv) >= 4) {
|
|
- I915_WRITE_FW(DSPSURF(plane),
|
|
|
|
|
|
+ I915_WRITE_FW(DSPSURF(i9xx_plane),
|
|
intel_plane_ggtt_offset(plane_state) +
|
|
intel_plane_ggtt_offset(plane_state) +
|
|
dspaddr_offset);
|
|
dspaddr_offset);
|
|
- I915_WRITE_FW(DSPTILEOFF(plane), (y << 16) | x);
|
|
|
|
- I915_WRITE_FW(DSPLINOFF(plane), linear_offset);
|
|
|
|
|
|
+ I915_WRITE_FW(DSPTILEOFF(i9xx_plane), (y << 16) | x);
|
|
|
|
+ I915_WRITE_FW(DSPLINOFF(i9xx_plane), linear_offset);
|
|
} else {
|
|
} else {
|
|
- I915_WRITE_FW(DSPADDR(plane),
|
|
|
|
|
|
+ I915_WRITE_FW(DSPADDR(i9xx_plane),
|
|
intel_plane_ggtt_offset(plane_state) +
|
|
intel_plane_ggtt_offset(plane_state) +
|
|
dspaddr_offset);
|
|
dspaddr_offset);
|
|
}
|
|
}
|
|
@@ -3284,32 +3284,31 @@ static void i9xx_update_primary_plane(struct intel_plane *primary,
|
|
spin_unlock_irqrestore(&dev_priv->uncore.lock, irqflags);
|
|
spin_unlock_irqrestore(&dev_priv->uncore.lock, irqflags);
|
|
}
|
|
}
|
|
|
|
|
|
-static void i9xx_disable_primary_plane(struct intel_plane *primary,
|
|
|
|
- struct intel_crtc *crtc)
|
|
|
|
|
|
+static void i9xx_disable_plane(struct intel_plane *plane,
|
|
|
|
+ struct intel_crtc *crtc)
|
|
{
|
|
{
|
|
- struct drm_i915_private *dev_priv = to_i915(primary->base.dev);
|
|
|
|
- enum plane plane = primary->plane;
|
|
|
|
|
|
+ struct drm_i915_private *dev_priv = to_i915(plane->base.dev);
|
|
|
|
+ enum i9xx_plane_id i9xx_plane = plane->i9xx_plane;
|
|
unsigned long irqflags;
|
|
unsigned long irqflags;
|
|
|
|
|
|
spin_lock_irqsave(&dev_priv->uncore.lock, irqflags);
|
|
spin_lock_irqsave(&dev_priv->uncore.lock, irqflags);
|
|
|
|
|
|
- I915_WRITE_FW(DSPCNTR(plane), 0);
|
|
|
|
- if (INTEL_INFO(dev_priv)->gen >= 4)
|
|
|
|
- I915_WRITE_FW(DSPSURF(plane), 0);
|
|
|
|
|
|
+ I915_WRITE_FW(DSPCNTR(i9xx_plane), 0);
|
|
|
|
+ if (INTEL_GEN(dev_priv) >= 4)
|
|
|
|
+ I915_WRITE_FW(DSPSURF(i9xx_plane), 0);
|
|
else
|
|
else
|
|
- I915_WRITE_FW(DSPADDR(plane), 0);
|
|
|
|
- POSTING_READ_FW(DSPCNTR(plane));
|
|
|
|
|
|
+ I915_WRITE_FW(DSPADDR(i9xx_plane), 0);
|
|
|
|
+ POSTING_READ_FW(DSPCNTR(i9xx_plane));
|
|
|
|
|
|
spin_unlock_irqrestore(&dev_priv->uncore.lock, irqflags);
|
|
spin_unlock_irqrestore(&dev_priv->uncore.lock, irqflags);
|
|
}
|
|
}
|
|
|
|
|
|
-static bool i9xx_plane_get_hw_state(struct intel_plane *primary)
|
|
|
|
|
|
+static bool i9xx_plane_get_hw_state(struct intel_plane *plane)
|
|
{
|
|
{
|
|
-
|
|
|
|
- struct drm_i915_private *dev_priv = to_i915(primary->base.dev);
|
|
|
|
|
|
+ struct drm_i915_private *dev_priv = to_i915(plane->base.dev);
|
|
enum intel_display_power_domain power_domain;
|
|
enum intel_display_power_domain power_domain;
|
|
- enum plane plane = primary->plane;
|
|
|
|
- enum pipe pipe = primary->pipe;
|
|
|
|
|
|
+ enum i9xx_plane_id i9xx_plane = plane->i9xx_plane;
|
|
|
|
+ enum pipe pipe = plane->pipe;
|
|
bool ret;
|
|
bool ret;
|
|
|
|
|
|
/*
|
|
/*
|
|
@@ -3321,7 +3320,7 @@ static bool i9xx_plane_get_hw_state(struct intel_plane *primary)
|
|
if (!intel_display_power_get_if_enabled(dev_priv, power_domain))
|
|
if (!intel_display_power_get_if_enabled(dev_priv, power_domain))
|
|
return false;
|
|
return false;
|
|
|
|
|
|
- ret = I915_READ(DSPCNTR(plane)) & DISPLAY_PLANE_ENABLE;
|
|
|
|
|
|
+ ret = I915_READ(DSPCNTR(i9xx_plane)) & DISPLAY_PLANE_ENABLE;
|
|
|
|
|
|
intel_display_power_put(dev_priv, power_domain);
|
|
intel_display_power_put(dev_priv, power_domain);
|
|
|
|
|
|
@@ -7406,7 +7405,7 @@ i9xx_get_initial_plane_config(struct intel_crtc *crtc,
|
|
struct drm_device *dev = crtc->base.dev;
|
|
struct drm_device *dev = crtc->base.dev;
|
|
struct drm_i915_private *dev_priv = to_i915(dev);
|
|
struct drm_i915_private *dev_priv = to_i915(dev);
|
|
u32 val, base, offset;
|
|
u32 val, base, offset;
|
|
- int pipe = crtc->pipe, plane = crtc->plane;
|
|
|
|
|
|
+ int pipe = crtc->pipe, plane = crtc->i9xx_plane;
|
|
int fourcc, pixel_format;
|
|
int fourcc, pixel_format;
|
|
unsigned int aligned_height;
|
|
unsigned int aligned_height;
|
|
struct drm_framebuffer *fb;
|
|
struct drm_framebuffer *fb;
|
|
@@ -13272,9 +13271,9 @@ intel_primary_plane_create(struct drm_i915_private *dev_priv, enum pipe pipe)
|
|
* port is hooked to pipe B. Hence we want plane A feeding pipe B.
|
|
* port is hooked to pipe B. Hence we want plane A feeding pipe B.
|
|
*/
|
|
*/
|
|
if (HAS_FBC(dev_priv) && INTEL_GEN(dev_priv) < 4)
|
|
if (HAS_FBC(dev_priv) && INTEL_GEN(dev_priv) < 4)
|
|
- primary->plane = (enum plane) !pipe;
|
|
|
|
|
|
+ primary->i9xx_plane = (enum i9xx_plane_id) !pipe;
|
|
else
|
|
else
|
|
- primary->plane = (enum plane) pipe;
|
|
|
|
|
|
+ primary->i9xx_plane = (enum i9xx_plane_id) pipe;
|
|
primary->id = PLANE_PRIMARY;
|
|
primary->id = PLANE_PRIMARY;
|
|
primary->frontbuffer_bit = INTEL_FRONTBUFFER_PRIMARY(pipe);
|
|
primary->frontbuffer_bit = INTEL_FRONTBUFFER_PRIMARY(pipe);
|
|
primary->check_plane = intel_check_primary_plane;
|
|
primary->check_plane = intel_check_primary_plane;
|
|
@@ -13303,16 +13302,16 @@ intel_primary_plane_create(struct drm_i915_private *dev_priv, enum pipe pipe)
|
|
num_formats = ARRAY_SIZE(i965_primary_formats);
|
|
num_formats = ARRAY_SIZE(i965_primary_formats);
|
|
modifiers = i9xx_format_modifiers;
|
|
modifiers = i9xx_format_modifiers;
|
|
|
|
|
|
- primary->update_plane = i9xx_update_primary_plane;
|
|
|
|
- primary->disable_plane = i9xx_disable_primary_plane;
|
|
|
|
|
|
+ primary->update_plane = i9xx_update_plane;
|
|
|
|
+ primary->disable_plane = i9xx_disable_plane;
|
|
primary->get_hw_state = i9xx_plane_get_hw_state;
|
|
primary->get_hw_state = i9xx_plane_get_hw_state;
|
|
} else {
|
|
} else {
|
|
intel_primary_formats = i8xx_primary_formats;
|
|
intel_primary_formats = i8xx_primary_formats;
|
|
num_formats = ARRAY_SIZE(i8xx_primary_formats);
|
|
num_formats = ARRAY_SIZE(i8xx_primary_formats);
|
|
modifiers = i9xx_format_modifiers;
|
|
modifiers = i9xx_format_modifiers;
|
|
|
|
|
|
- primary->update_plane = i9xx_update_primary_plane;
|
|
|
|
- primary->disable_plane = i9xx_disable_primary_plane;
|
|
|
|
|
|
+ primary->update_plane = i9xx_update_plane;
|
|
|
|
+ primary->disable_plane = i9xx_disable_plane;
|
|
primary->get_hw_state = i9xx_plane_get_hw_state;
|
|
primary->get_hw_state = i9xx_plane_get_hw_state;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -13336,7 +13335,8 @@ intel_primary_plane_create(struct drm_i915_private *dev_priv, enum pipe pipe)
|
|
intel_primary_formats, num_formats,
|
|
intel_primary_formats, num_formats,
|
|
modifiers,
|
|
modifiers,
|
|
DRM_PLANE_TYPE_PRIMARY,
|
|
DRM_PLANE_TYPE_PRIMARY,
|
|
- "plane %c", plane_name(primary->plane));
|
|
|
|
|
|
+ "plane %c",
|
|
|
|
+ plane_name(primary->i9xx_plane));
|
|
if (ret)
|
|
if (ret)
|
|
goto fail;
|
|
goto fail;
|
|
|
|
|
|
@@ -13396,7 +13396,7 @@ intel_cursor_plane_create(struct drm_i915_private *dev_priv,
|
|
cursor->can_scale = false;
|
|
cursor->can_scale = false;
|
|
cursor->max_downscale = 1;
|
|
cursor->max_downscale = 1;
|
|
cursor->pipe = pipe;
|
|
cursor->pipe = pipe;
|
|
- cursor->plane = pipe;
|
|
|
|
|
|
+ cursor->i9xx_plane = (enum i9xx_plane_id) pipe;
|
|
cursor->id = PLANE_CURSOR;
|
|
cursor->id = PLANE_CURSOR;
|
|
cursor->frontbuffer_bit = INTEL_FRONTBUFFER_CURSOR(pipe);
|
|
cursor->frontbuffer_bit = INTEL_FRONTBUFFER_CURSOR(pipe);
|
|
|
|
|
|
@@ -13524,14 +13524,14 @@ static int intel_crtc_init(struct drm_i915_private *dev_priv, enum pipe pipe)
|
|
goto fail;
|
|
goto fail;
|
|
|
|
|
|
intel_crtc->pipe = pipe;
|
|
intel_crtc->pipe = pipe;
|
|
- intel_crtc->plane = primary->plane;
|
|
|
|
|
|
+ intel_crtc->i9xx_plane = primary->i9xx_plane;
|
|
|
|
|
|
/* initialize shared scalers */
|
|
/* initialize shared scalers */
|
|
intel_crtc_init_scalers(intel_crtc, crtc_state);
|
|
intel_crtc_init_scalers(intel_crtc, crtc_state);
|
|
|
|
|
|
BUG_ON(pipe >= ARRAY_SIZE(dev_priv->plane_to_crtc_mapping) ||
|
|
BUG_ON(pipe >= ARRAY_SIZE(dev_priv->plane_to_crtc_mapping) ||
|
|
- dev_priv->plane_to_crtc_mapping[intel_crtc->plane] != NULL);
|
|
|
|
- dev_priv->plane_to_crtc_mapping[intel_crtc->plane] = intel_crtc;
|
|
|
|
|
|
+ dev_priv->plane_to_crtc_mapping[intel_crtc->i9xx_plane] != NULL);
|
|
|
|
+ dev_priv->plane_to_crtc_mapping[intel_crtc->i9xx_plane] = intel_crtc;
|
|
dev_priv->pipe_to_crtc_mapping[intel_crtc->pipe] = intel_crtc;
|
|
dev_priv->pipe_to_crtc_mapping[intel_crtc->pipe] = intel_crtc;
|
|
|
|
|
|
drm_crtc_helper_add(&intel_crtc->base, &intel_helper_funcs);
|
|
drm_crtc_helper_add(&intel_crtc->base, &intel_helper_funcs);
|
|
@@ -14788,11 +14788,11 @@ void i830_disable_pipe(struct drm_i915_private *dev_priv, enum pipe pipe)
|
|
}
|
|
}
|
|
|
|
|
|
static bool intel_plane_mapping_ok(struct intel_crtc *crtc,
|
|
static bool intel_plane_mapping_ok(struct intel_crtc *crtc,
|
|
- struct intel_plane *primary)
|
|
|
|
|
|
+ struct intel_plane *plane)
|
|
{
|
|
{
|
|
struct drm_i915_private *dev_priv = to_i915(crtc->base.dev);
|
|
struct drm_i915_private *dev_priv = to_i915(crtc->base.dev);
|
|
- enum plane plane = primary->plane;
|
|
|
|
- u32 val = I915_READ(DSPCNTR(plane));
|
|
|
|
|
|
+ enum i9xx_plane_id i9xx_plane = plane->i9xx_plane;
|
|
|
|
+ u32 val = I915_READ(DSPCNTR(i9xx_plane));
|
|
|
|
|
|
return (val & DISPLAY_PLANE_ENABLE) == 0 ||
|
|
return (val & DISPLAY_PLANE_ENABLE) == 0 ||
|
|
(val & DISPPLANE_SEL_PIPE_MASK) == DISPPLANE_SEL_PIPE(crtc->pipe);
|
|
(val & DISPPLANE_SEL_PIPE_MASK) == DISPPLANE_SEL_PIPE(crtc->pipe);
|