[Mesa-dev] [PATCH 2/2] i965: Context aware user space EU control through application
Marathe, Yogesh
yogesh.marathe at intel.com
Tue Jul 24 16:58:14 UTC 2018
> -----Original Message-----
> From: Landwerlin, Lionel G
> Sent: Tuesday, July 24, 2018 10:24 PM
> To: Marathe, Yogesh <yogesh.marathe at intel.com>; Chris Wilson <chris at chris-
> wilson.co.uk>; Muthukumar, Aravindan <aravindan.muthukumar at intel.com>;
> mesa-dev at lists.freedesktop.org
> Cc: Diwakar, Praveen <praveen.diwakar at intel.com>
> Subject: Re: [Mesa-dev] [PATCH 2/2] i965: Context aware user space EU control
> through application
>
> On 24/07/18 17:41, Marathe, Yogesh wrote:
> > Lionel, Chris,
> >
> >> -----Original Message-----
> >> From: mesa-dev [mailto:mesa-dev-bounces at lists.freedesktop.org] On
> >> Behalf Of Lionel Landwerlin
> >> Sent: Friday, July 20, 2018 3:31 PM
> >> To: Chris Wilson <chris at chris-wilson.co.uk>; Muthukumar, Aravindan
> >> <aravindan.muthukumar at intel.com>; mesa-dev at lists.freedesktop.org
> >> Subject: Re: [Mesa-dev] [PATCH 2/2] i965: Context aware user space EU
> >> control through application
> >>
> >> On 20/07/18 09:47, Chris Wilson wrote:
> >>> 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
> >>> ______
> >> Yep,
> >>
> >> Looks like you want to get involved in this discussion :
> >> https://patchwork.freedesktop.org/series/42285/
> > I understand this is exposing per context eu config through debugfs.
> > That mostly (if not fully) matches the kernel part of what we wanted
> > to achieve. We have additional code in kernel where we categorize
> > based on load type and fix a config per platform. For sure the kernel
> > parts can be merged but the proposal is different here and its specific to
> adding this capability through mesa.
> >
> > Here we are enabling applications to decide load while creating the
> > context and making it simple for application programmers by
> > abstracting it. Also in these kernel patches, its seems to be
> > exposing the parameters to user space, are we discussing its user
> > space counterpart in mesa or in some other component? If not, I feel
> > this is bit different. Can it be a mesa extension? Then any app / process can do
> this without having privilege (root).
>
> Yes, I was just pointing out that you might want to reuse existing patches for
> i915 so that we don't end up with 2 similar interfaces there.
> Obviously your extension would still be needed.
>
Thanks, that’s clear now.
> -
> Lionel
>
> >
> >> -
> >> Lionel
> >> _______________________________________________
> >> mesa-dev mailing list
> >> mesa-dev at lists.freedesktop.org
> >> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
>
More information about the mesa-dev
mailing list