drm/i915: split out Ironlake pipe bpp picking code
authorJesse Barnes <jbarnes@virtuousgeek.org>
Fri, 24 Jun 2011 19:19:22 +0000 (12:19 -0700)
committerKeith Packard <keithp@keithp.com>
Thu, 7 Jul 2011 20:20:34 +0000 (13:20 -0700)
commit5a3542041bf85a65633ed203c3782492116ebb94
tree809fc9808011b5d2f20bf870d5472f093ee9c03b
parent9325c9f088c42e3e07475d4f733ee6539ebf9c0b
drm/i915: split out Ironlake pipe bpp picking code

Figuring out which pipe bpp to use is a bit painful.  It depends on both
the encoder and display configuration attached to a pipe.  For instance,
to drive a 24bpp framebuffer out to an 18bpp panel, we need to use 6bpc
on the pipe but also enable dithering.  But driving that same
framebuffer to a DisplayPort output on another pipe means using 8bpc and
no dithering.

So split out and enhance the code to handle the various cases, returning
an appropriate pipe bpp as well as whether dithering should be enabled.

Save the resulting pipe bpp in the intel_crtc struct for use by encoders
in calculating bandwidth requirements (defaults to 24bpp on pre-ILK).

Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Keith Packard <keithp@keithp.com>
drivers/gpu/drm/i915/intel_display.c
drivers/gpu/drm/i915/intel_drv.h