[Intel-gfx] [PATCH] drm/i915: Add GuC css header parser

Yu Dai yu.dai at intel.com
Thu Sep 3 09:52:50 PDT 2015



On 09/03/2015 12:36 AM, Jani Nikula wrote:
> On Thu, 03 Sep 2015, yu.dai at intel.com wrote:
> > From: Alex Dai <yu.dai at intel.com>
> >
> > By using information from GuC css header, we can eliminate some
> > hard code w.r.t size of some components of firmware.
> >
> > Signed-off-by: Alex Dai <yu.dai at intel.com>
> > ---
> >  drivers/gpu/drm/i915/intel_guc.h        |  2 +-
> >  drivers/gpu/drm/i915/intel_guc_fwif.h   | 36 +++++++++++++
> >  drivers/gpu/drm/i915/intel_guc_loader.c | 91 ++++++++++++++++++++++-----------
> >  3 files changed, 98 insertions(+), 31 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/i915/intel_guc.h b/drivers/gpu/drm/i915/intel_guc.h
> > index 4ec2d27..e1389fc 100644
> > --- a/drivers/gpu/drm/i915/intel_guc.h
> > +++ b/drivers/gpu/drm/i915/intel_guc.h
> > @@ -71,6 +71,7 @@ struct intel_guc_fw {
> >  	struct drm_i915_gem_object *	guc_fw_obj;
> >  	enum intel_guc_fw_status	guc_fw_fetch_status;
> >  	enum intel_guc_fw_status	guc_fw_load_status;
> > +	struct guc_css_header		guc_fw_header;
> >
> >  	uint16_t			guc_fw_major_wanted;
> >  	uint16_t			guc_fw_minor_wanted;
> > @@ -80,7 +81,6 @@ struct intel_guc_fw {
> >
> >  struct intel_guc {
> >  	struct intel_guc_fw guc_fw;
> > -
> >  	uint32_t log_flags;
> >  	struct drm_i915_gem_object *log_obj;
> >
> > diff --git a/drivers/gpu/drm/i915/intel_guc_fwif.h b/drivers/gpu/drm/i915/intel_guc_fwif.h
> > index e1f47ba..d6cb4e8 100644
> > --- a/drivers/gpu/drm/i915/intel_guc_fwif.h
> > +++ b/drivers/gpu/drm/i915/intel_guc_fwif.h
> > @@ -122,6 +122,42 @@
> >
> >  #define GUC_CTL_MAX_DWORDS		(GUC_CTL_RSRVD + 1)
> >
> > +struct guc_css_header {
> > +	uint32_t module_type;
> > +	uint32_t header_len; /* header length plus size of all other keys */
> > +	uint32_t header_version;
> > +	uint32_t module_id;
> > +	uint32_t module_vendor;
> > +	union {
> > +		struct {
> > +			uint8_t day;
> > +			uint8_t month;
> > +			uint16_t year;
> > +		};
> > +		uint32_t date;
> > +	};
> > +	uint32_t size; /* uCode size plus header_len */
> > +	uint32_t key_size;
> > +	uint32_t modulus_size;
> > +	uint32_t exponent_size;
> > +	union {
> > +		struct {
> > +			uint8_t hour;
> > +			uint8_t min;
> > +			uint16_t sec;
> > +		};
> > +		uint32_t time;
> > +	};
> > +
> > +	char username[8];
> > +	char buildnumber[12];
> > +	uint32_t device_id;
> > +	uint32_t guc_sw_version;
> > +	uint32_t prod_preprod_fw;
> > +	uint32_t reserved[12];
> > +	uint32_t header_info;
> > +};
>
> Drive-by review, this will need __packed.
>
>
Yes, will correct this in next version. Thanks, -Alex


More information about the Intel-gfx mailing list