[PATCH] drm: Try loading builtin EDIDs first

Ville Syrjälä ville.syrjala at linux.intel.com
Wed Oct 2 02:56:22 PDT 2013


On Wed, Oct 02, 2013 at 10:32:35AM +0100, Chris Wilson wrote:
> On Wed, Oct 02, 2013 at 12:22:07PM +0300, Ville Syrjälä wrote:
> > > +static bool edid_check_size(const u8 *data, int data_size)
> > > +{
> > > +	if (data[0x7e] > 0x7e)
> > > +		return false;
> > 
> > That should be 'if (data_size <= 0x7e) return false;' no?
> > 
> > Or maybe just 'data_size < EDID_LENGTH' since we anyway want a
> > multiple of EDID_LENGTH.
> 
> Hmm, I'm missing the point here then. If edid_size() only returns a
> non-zero mulitple of EDID_LENGTH, data_size must also be a non-zero
> multiple of EDID_LENGTH for it to pass.

The point is to check that the edid[0x7e] access in fact lands inside
our data and not somewhere else.

> 
> If you want to simply give me your ideal check_size()... :)
> -Chris
> 
> -- 
> Chris Wilson, Intel Open Source Technology Centre

-- 
Ville Syrjälä
Intel OTC


More information about the dri-devel mailing list