[Mesa-dev] [PATCH 2/2] i965: Context aware user space EU control through application
Chris Wilson
chris at chris-wilson.co.uk
Fri Jul 20 08:47:04 UTC 2018
Quoting aravindan.muthukumar at intel.com (2018-07-20 09:32:57)
> From: "Muthukumar, Aravindan" <aravindan.muthukumar at intel.com>
>
> The Patch here is to give control to user/ application to really
> decide what's the max GPU load it would put. If that can be
> known in advance, rpcs can be programmed accordingly.
> This solution has changes across i915,
> drm and mesa (not limited only to kernel).
>
> Here, we pass gpu_load_type = {high, medium, low} from application
> while context is created. Default here is 'High' and applications
> roughly know if they are going to eat up entire GPU. The typical
> usecase of 'Low' is idle screen or minor mouse movements. Users can
> read meaning of high/medium/low for their platform & then program
> contexts accordingly. Here gpu_load_type directly translates to
> number of shader cores/EUs a particular GPU has.
>
> Signed-off-by: Aravindan Muthukumar <aravindan.muthukumar at intel.com>
> Signed-off-by: Kedar J Karanje <kedar.j.karanje at intel.com>
> Signed-off-by: Praveen Diwakar <praveen.diwakar at intel.com>
> Signed-off-by: Yogesh Marathe <yogesh.marathe at intel.com>
> +/* Dynamic Eu control */
> +struct drm_i915_load_type {
> + __u32 ctx_id;
> + __u32 load_type;
> +};
> +
> +/* DYNAMIC EU CONTROL */
> +int
> +brw_hw_context_load_type(struct brw_bufmgr *bufmgr,
> + uint32_t ctx_id,
> + int load_type)
> +{
> + struct drm_i915_load_type type = {
> + .ctx_id = ctx_id,
> + .load_type = load_type,
> + };
> + int err;
> +
> + err = 0;
> + if(drmIoctl(bufmgr->fd, DRM_IOCTL_I915_LOAD_TYPE, &type))
> + err = -errno;
This went through 4 people and none noticed that there already exists a
means to set per-context parameters. And it's even used right next to
this function.
The word hint needs to be firmly embedded around here.
-Chris
More information about the mesa-dev
mailing list