From: Damien Lespiau <damien.lespiau@intel.com>
To: jeff.mcgee@intel.com
Cc: intel-gfx@lists.freedesktop.org, beignet@lists.freedesktop.org,
dri-devel@lists.freedesktop.org
Subject: Re: [PATCH] intel: Export total subslice and EU counts
Date: Wed, 18 Mar 2015 17:11:34 +0000 [thread overview]
Message-ID: <20150318171134.GC25699@strange.ger.corp.intel.com> (raw)
In-Reply-To: <1425339567-18933-1-git-send-email-jeff.mcgee@intel.com>
On Mon, Mar 02, 2015 at 03:39:27PM -0800, jeff.mcgee@intel.com wrote:
> From: Jeff McGee <jeff.mcgee@intel.com>
2 small details, but otherwise:
Reviewed-by: Damien Lespiau <damien.lespiau@intel.com>
> Update kernel interface with new I915_GETPARAM ioctl entries for
> subslice total and EU total. Add a wrapping function for each
> parameter. Userspace drivers need these values when constructing
> GPGPU commands. This kernel query method is intended to replace
> the PCI ID-based tables that userspace drivers currently maintain.
> The kernel driver can employ fuse register reads as needed to
> ensure the most accurate determination of GT config attributes.
> This first became important with Cherryview in which the config
> could differ between devices with the same PCI ID.
>
> The kernel detection of these values is device-specific. Userspace
> drivers should continue to maintain ID-based tables for older
> devices which return ENODEV when using this query.
This should probably part of some comment near the API entry point.
>
> For: VIZ-4636
> Signed-off-by: Jeff McGee <jeff.mcgee@intel.com>
> ---
> include/drm/i915_drm.h | 2 ++
> intel/intel_bufmgr.h | 4 ++++
> intel/intel_bufmgr_gem.c | 31 +++++++++++++++++++++++++++++++
> 3 files changed, 37 insertions(+)
>
> diff --git a/include/drm/i915_drm.h b/include/drm/i915_drm.h
> index 15dd01d..e34f5b2 100644
> --- a/include/drm/i915_drm.h
> +++ b/include/drm/i915_drm.h
> @@ -340,6 +340,8 @@ 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_SUBSLICE_TOTAL 32
> +#define I915_PARAM_EU_TOTAL 33
>
> typedef struct drm_i915_getparam {
> int param;
> diff --git a/intel/intel_bufmgr.h b/intel/intel_bufmgr.h
> index be83a56..4b2472e 100644
> --- a/intel/intel_bufmgr.h
> +++ b/intel/intel_bufmgr.h
> @@ -37,6 +37,7 @@
> #include <stdio.h>
> #include <stdint.h>
> #include <stdio.h>
> +#include <stdbool.h>
But you don't seem to use bool or _Bool in the rest of the patch?
> struct drm_clip_rect;
>
> @@ -264,6 +265,9 @@ int drm_intel_get_reset_stats(drm_intel_context *ctx,
> uint32_t *active,
> uint32_t *pending);
>
> +int drm_intel_get_subslice_total(int fd, unsigned int *subslice_total);
> +int drm_intel_get_eu_total(int fd, unsigned int *eu_total);
> +
> /** @{ 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 78875fd..2d77f32 100644
> --- a/intel/intel_bufmgr_gem.c
> +++ b/intel/intel_bufmgr_gem.c
> @@ -3292,6 +3292,37 @@ drm_intel_reg_read(drm_intel_bufmgr *bufmgr,
> return ret;
> }
>
> +drm_public int
> +drm_intel_get_subslice_total(int fd, unsigned int *subslice_total)
> +{
> + drm_i915_getparam_t gp;
> + int ret;
> +
> + memclear(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;
> +
> + memclear(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;
> +}
>
> /**
> * Annotate the given bo for use in aub dumping.
> --
> 2.3.0
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/dri-devel
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel
prev parent reply other threads:[~2015-03-18 17:11 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-02 23:39 [PATCH] intel: Export total subslice and EU counts jeff.mcgee
2015-03-09 23:13 ` [PATCH 1/2 v2] " jeff.mcgee
2015-03-09 23:13 ` [PATCH 2/2] configure.ac: bump version to 2.4.60 for release jeff.mcgee
2015-03-18 18:18 ` [PATCH 1/2 v2] intel: Export total subslice and EU counts Damien Lespiau
2015-03-18 17:11 ` Damien Lespiau [this message]
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=20150318171134.GC25699@strange.ger.corp.intel.com \
--to=damien.lespiau@intel.com \
--cc=beignet@lists.freedesktop.org \
--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;
as well as URLs for NNTP newsgroup(s).