Commit 39ccc04e authored by Ville Syrjälä's avatar Ville Syrjälä

drm/i915: Use primary plane->state for overlay ckey setup

Extract the primary plane pixel format via plane state when setting up
the overlay colorkey.
Signed-off-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1481131693-27993-10-git-send-email-ville.syrjala@linux.intel.comReviewed-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
parent 2daac462
...@@ -690,31 +690,32 @@ static bool update_scaling_factors(struct intel_overlay *overlay, ...@@ -690,31 +690,32 @@ static bool update_scaling_factors(struct intel_overlay *overlay,
static void update_colorkey(struct intel_overlay *overlay, static void update_colorkey(struct intel_overlay *overlay,
struct overlay_registers __iomem *regs) struct overlay_registers __iomem *regs)
{ {
const struct intel_plane_state *state =
to_intel_plane_state(overlay->crtc->base.primary->state);
u32 key = overlay->color_key; u32 key = overlay->color_key;
u32 flags; u32 format = 0;
u32 flags = 0;
flags = 0;
if (overlay->color_key_enabled) if (overlay->color_key_enabled)
flags |= DST_KEY_ENABLE; flags |= DST_KEY_ENABLE;
switch (overlay->crtc->base.primary->fb->bits_per_pixel) { if (state->base.visible)
case 8: format = state->base.fb->pixel_format;
switch (format) {
case DRM_FORMAT_C8:
key = 0; key = 0;
flags |= CLK_RGB8I_MASK; flags |= CLK_RGB8I_MASK;
break; break;
case DRM_FORMAT_XRGB1555:
case 16: key = RGB15_TO_COLORKEY(key);
if (overlay->crtc->base.primary->fb->depth == 15) { flags |= CLK_RGB15_MASK;
key = RGB15_TO_COLORKEY(key);
flags |= CLK_RGB15_MASK;
} else {
key = RGB16_TO_COLORKEY(key);
flags |= CLK_RGB16_MASK;
}
break; break;
case DRM_FORMAT_RGB565:
case 24: key = RGB16_TO_COLORKEY(key);
case 32: flags |= CLK_RGB16_MASK;
break;
default:
flags |= CLK_RGB24_MASK; flags |= CLK_RGB24_MASK;
break; break;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment