[Intel-gfx] [PATCH 10/29] drm/i915: s/is_sdvob/enum port/
Chris Wilson
chris at chris-wilson.co.uk
Thu Nov 5 06:05:39 PST 2015
On Wed, Nov 04, 2015 at 11:19:58PM +0200, ville.syrjala at linux.intel.com wrote:
> From: Ville Syrjälä <ville.syrjala at linux.intel.com>
>
> Replace the is_sdvob bool and some sdvo_reg checks with enum port. This
> makes the SDVO code look more modern, and gets rid of explicit register
> offset checks in the code which will hamper register type checking.
>
> Signed-off-by: Ville Syrjälä <ville.syrjala at linux.intel.com>
Ok, I had to actually read the code to verify some of the changes!
> @@ -2950,7 +2945,7 @@ bool intel_sdvo_init(struct drm_device *dev, uint32_t sdvo_reg, bool is_sdvob)
> return false;
>
> intel_sdvo->sdvo_reg = sdvo_reg;
> - intel_sdvo->is_sdvob = is_sdvob;
> + intel_sdvo->port = port;
I wonder if it is worth putting a little verification in here like
assert_sdvo_port_valid() {
if (HAS_PCH(dev)
WARN_ON(port != PORT_B);
else
WARN_ON(port != PORT_B || port != PORT_C);
}
But anyway,
Reviewed-by: Chris Wilson <chris at chris-wilson.co.uk>
-Chris
--
Chris Wilson, Intel Open Source Technology Centre
More information about the Intel-gfx
mailing list