[Intel-gfx] [RFC 7/7] drm/i915/bios: hide away VBT specific things in a private bios header

Daniel Vetter daniel at ffwll.ch
Wed Dec 16 03:03:10 PST 2015


On Tue, Dec 15, 2015 at 05:33:38PM +0200, Jani Nikula wrote:
> We've been accumulating code across the driver that depends on the VBT
> specific structures and defines. The VBT is an uncontrollable
> beast. Encourage encapsulation of the VBT data by hiding the structures
> and defines in a private header only to be included from intel_bios.c.
> 
> Signed-off-by: Jani Nikula <jani.nikula at intel.com>
> ---
>  drivers/gpu/drm/i915/intel_bios.c                  |    2 +-
>  drivers/gpu/drm/i915/intel_bios.h                  | 1224 ++++----------------
>  .../i915/{intel_bios.h => intel_bios_private.h}    |  230 +---
>  3 files changed, 262 insertions(+), 1194 deletions(-)
>  rewrite drivers/gpu/drm/i915/intel_bios.h (76%)
>  rename drivers/gpu/drm/i915/{intel_bios.h => intel_bios_private.h} (81%)
> 
> diff --git a/drivers/gpu/drm/i915/intel_bios.c b/drivers/gpu/drm/i915/intel_bios.c
> index f45ebf7bdc31..f985b6e7fb43 100644
> --- a/drivers/gpu/drm/i915/intel_bios.c
> +++ b/drivers/gpu/drm/i915/intel_bios.c
> @@ -29,7 +29,7 @@
>  #include <drm/drmP.h>
>  #include <drm/i915_drm.h>
>  #include "i915_drv.h"
> -#include "intel_bios.h"
> +#include "intel_bios_private.h"
>  
>  #define	SLAVE_ADDR1	0x70
>  #define	SLAVE_ADDR2	0x72
> diff --git a/drivers/gpu/drm/i915/intel_bios.h b/drivers/gpu/drm/i915/intel_bios.h
> dissimilarity index 76%
> index 54eac1003a1e..929b74bf3593 100644
> --- a/drivers/gpu/drm/i915/intel_bios.h
> +++ b/drivers/gpu/drm/i915/intel_bios.h

[snip]

> +#endif /* _INTEL_BIOS_PRIVATE_H_ */

Wrong #endif comment. And maybe we should just call this intel_vbt.h or
similar, to make it a bit clearer what it's for.

Anyway I like this, but if we go to the trouble of cleaning things up I
think some kerneldoc on top to explain the idea, pulled into gpu.tmpl
together with the interface functions is needed.

Cheers, Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch


More information about the Intel-gfx mailing list