public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Zhenyu Wang <zhenyuw@linux.intel.com>
To: jeff.mcgee@intel.com
Cc: intel-gfx <intel-gfx@lists.freedesktop.org>,
	dri-devel@lists.freedesktop.org
Subject: Re: [PATCH] intel: Export GT config attributes
Date: Fri, 9 Jan 2015 10:56:16 +0800	[thread overview]
Message-ID: <20150109025616.GM971@zhen-hp.sh.intel.com> (raw)
In-Reply-To: <1418926353-10871-2-git-send-email-jeff.mcgee@intel.com>


[-- Attachment #1.1: Type: text/plain, Size: 3676 bytes --]

On 2014.12.18 12:12:33 -0600, jeff.mcgee@intel.com wrote:
> diff --git a/include/drm/i915_drm.h b/include/drm/i915_drm.h
> index 15dd01d..be38adf 100644
> --- a/include/drm/i915_drm.h
> +++ b/include/drm/i915_drm.h
> @@ -340,6 +340,10 @@ typedef struct drm_i915_irq_wait {
>  #define I915_PARAM_HAS_EXEC_HANDLE_LUT   26
>  #define I915_PARAM_HAS_WT     	 	 27
>  #define I915_PARAM_CMD_PARSER_VERSION	 28
> +#define I915_PARAM_SLICE_TOTAL		 30
> +#define I915_PARAM_SUBSLICE_TOTAL	 31
> +#define I915_PARAM_EU_TOTAL		 32
> +#define I915_PARAM_THREADS_PER_EU	 33
>  
>  typedef struct drm_i915_getparam {
>  	int param;
> diff --git a/intel/intel_bufmgr.h b/intel/intel_bufmgr.h
> index be83a56..90e535d 100644
> --- a/intel/intel_bufmgr.h
> +++ b/intel/intel_bufmgr.h
> @@ -264,6 +264,11 @@ int drm_intel_get_reset_stats(drm_intel_context *ctx,
>  			      uint32_t *active,
>  			      uint32_t *pending);
>  
> +int drm_intel_get_slice_total(int fd, unsigned int *slice_total);
> +int drm_intel_get_subslice_total(int fd, unsigned int *subslice_total);
> +int drm_intel_get_eu_total(int fd, unsigned int *eu_total);
> +int drm_intel_get_threads_per_eu(int fd, unsigned int *threads_per_eu);
> +

I think we normally use drm_intel_bufmgr in API instead of fd directly.
And this config info can be initialized when bufmgr init, so later request
can get info without calling ioctl everytime.

Also please cc intel-gfx list for any intel related patch.

thanks.

>  /** @{ Compatibility defines to keep old code building despite the symbol rename
>   * from dri_* to drm_intel_*
>   */
> diff --git a/intel/intel_bufmgr_gem.c b/intel/intel_bufmgr_gem.c
> index 14e92c9..e0b13e7 100644
> --- a/intel/intel_bufmgr_gem.c
> +++ b/intel/intel_bufmgr_gem.c
> @@ -3293,6 +3293,69 @@ drm_intel_reg_read(drm_intel_bufmgr *bufmgr,
>  	return ret;
>  }
>  
> +drm_public int
> +drm_intel_get_slice_total(int fd, unsigned int *slice_total)
> +{
> +	drm_i915_getparam_t gp;
> +	int ret;
> +
> +	VG_CLEAR(gp);
> +	gp.value = (int*)slice_total;
> +	gp.param = I915_PARAM_SLICE_TOTAL;
> +	ret = drmIoctl(fd, DRM_IOCTL_I915_GETPARAM, &gp);
> +	if (ret)
> +		return -errno;
> +
> +	return 0;
> +}
> +
> +drm_public int
> +drm_intel_get_subslice_total(int fd, unsigned int *subslice_total)
> +{
> +	drm_i915_getparam_t gp;
> +	int ret;
> +
> +	VG_CLEAR(gp);
> +	gp.value = (int*)subslice_total;
> +	gp.param = I915_PARAM_SUBSLICE_TOTAL;
> +	ret = drmIoctl(fd, DRM_IOCTL_I915_GETPARAM, &gp);
> +	if (ret)
> +		return -errno;
> +
> +	return 0;
> +}
> +
> +drm_public int
> +drm_intel_get_eu_total(int fd, unsigned int *eu_total)
> +{
> +	drm_i915_getparam_t gp;
> +	int ret;
> +
> +	VG_CLEAR(gp);
> +	gp.value = (int*)eu_total;
> +	gp.param = I915_PARAM_EU_TOTAL;
> +	ret = drmIoctl(fd, DRM_IOCTL_I915_GETPARAM, &gp);
> +	if (ret)
> +		return -errno;
> +
> +	return 0;
> +}
> +
> +drm_public int
> +drm_intel_get_threads_per_eu(int fd, unsigned int *threads_per_eu)
> +{
> +	drm_i915_getparam_t gp;
> +	int ret;
> +
> +	VG_CLEAR(gp);
> +	gp.value = (int*)threads_per_eu;
> +	gp.param = I915_PARAM_THREADS_PER_EU;
> +	ret = drmIoctl(fd, DRM_IOCTL_I915_GETPARAM, &gp);
> +	if (ret)
> +		return -errno;
> +
> +	return 0;
> +}
>  
>  /**
>   * Annotate the given bo for use in aub dumping.
> -- 
> 2.2.0
> 
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/dri-devel

-- 
Open Source Technology Center, Intel ltd.

$gpg --keyserver wwwkeys.pgp.net --recv-keys 4D781827

[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 181 bytes --]

[-- Attachment #2: Type: text/plain, Size: 159 bytes --]

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

       reply	other threads:[~2015-01-09  2:56 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1418926353-10871-1-git-send-email-jeff.mcgee@intel.com>
     [not found] ` <1418926353-10871-2-git-send-email-jeff.mcgee@intel.com>
2015-01-09  2:56   ` Zhenyu Wang [this message]
2015-01-09 16:10     ` [PATCH] intel: Export GT config attributes Jeff McGee

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150109025616.GM971@zhen-hp.sh.intel.com \
    --to=zhenyuw@linux.intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=jeff.mcgee@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox