Skip to contentSkip to conversation

drm/i915: Revert "drm/i915: Reject the pin ioctl on gen6+"

PATCH In review Damien Lespiau 6 participants 9 messages Jul 3, 2014 – Oct 2, 2014

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/i915: Revert "drm/i915: Reject the pin ioctl on gen6+"

This reverts commit 02f6bcccf7c324115747aae2f0addd6af5d321cd.

The OA buffer can contain global data (in particular, not linked to a context or a single batch execution) about GPU events (eg. hw context switches, rc6 transitions, frequency changes, ...) and needs to be mapped to GGTT. The pin ioctl provided a way to do that.

Admittedly, this change broke what seems to be a valid use case of pinning a buffer in GGTT, even when PPGTT is used (which is the reason invoked in the commit message).

Cc Daniel Vetter <[email protected]>
Cc Tomasz Madajczak <[email protected]>
Cc Adam Rutkowski <[email protected]>
---
 drivers/gpu/drm/i915/i915_gem.c | 3 ---
 1 file changed, 3 deletions(-)
drivers/gpu/drm/i915/i915_gem.c +0 -3
index 1794a04..8019809 100644
@@ -4143,9 +4143,6 @@ i915_gem_pin_ioctl(struct drm_device *dev, void *data,
 	struct drm_i915_gem_object *obj;
 	int ret;
 
-	if (INTEL_INFO(dev)->gen >= 6)
-		return -ENODEV;
-
 	ret = i915_mutex_lock_interruptible(dev);
 	if (ret)
 		return ret;
Signature · 1 line
1.8.3.1
Acked-by on v1 1/1
#1 lore raw
Quoted 11 lines · Damien Lespiau

This reverts commit 02f6bcccf7c324115747aae2f0addd6af5d321cd.

The OA buffer can contain global data (in particular, not linked to a context or a single batch execution) about GPU events (eg. hw context switches, rc6 transitions, frequency changes, ...) and needs to be mapped to GGTT. The pin ioctl provided a way to do that.

Admittedly, this change broke what seems to be a valid use case of pinning a buffer in GGTT, even when PPGTT is used (which is the reason invoked in the commit message).

Quoted 5 lines
Cc Daniel Vetter <[email protected]>
Cc Tomasz Madajczak <[email protected]>
Cc Adam Rutkowski <[email protected]>

being confiscated
-Chris

Signature · 1 line
Chris Wilson, Intel Open Source Technology Centre
#2 lore raw
In reply to Damien Lespiau
Quoted 10 lines · Damien Lespiau

This reverts commit 02f6bcccf7c324115747aae2f0addd6af5d321cd.

The OA buffer can contain global data (in particular, not linked to a context or a single batch execution) about GPU events (eg. hw context switches, rc6 transitions, frequency changes, ...) and needs to be mapped to GGTT. The pin ioctl provided a way to do that.

Admittedly, this change broke what seems to be a valid use case of pinning a buffer in GGTT, even when PPGTT is used (which is the reason invoked in the commit message).

Global OA buffers should be handled by the kernel and exposed through perf, imo. I think I'll go lalala on this a bit longer ... -Daniel

Quoted 27 lines
Cc Daniel Vetter <[email protected]>
Cc Tomasz Madajczak <[email protected]>
Cc Adam Rutkowski <[email protected]>
---
 drivers/gpu/drm/i915/i915_gem.c | 3 ---
 1 file changed, 3 deletions(-)
drivers/gpu/drm/i915/i915_gem.c +0 -3
index 1794a04..8019809 100644
@@ -4143,9 +4143,6 @@ i915_gem_pin_ioctl(struct drm_device *dev, void *data,
 	struct drm_i915_gem_object *obj;
 	int ret;
 
-	if (INTEL_INFO(dev)->gen >= 6)
-		return -ENODEV;
-
 	ret = i915_mutex_lock_interruptible(dev);
 	if (ret)
 		return ret;
Signature · 1 line
1.8.3.1
Signature · 3 lines
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
#3 lore raw
Quoted 8 lines · On Mon, 7 Jul 2014 23:04:55 +0200 Daniel Vetter <[email protected]> wrote:
Quoted 7 lines · Damien Lespiau

This reverts commit 02f6bcccf7c324115747aae2f0addd6af5d321cd.

The OA buffer can contain global data (in particular, not linked to a context or a single batch execution) about GPU events (eg. hw context switches, rc6 transitions, frequency changes, ...) and needs to be mapped to GGTT. The pin ioctl provided a way to do that.

Quoted 6 lines
Quoted 3 lines

Admittedly, this change broke what seems to be a valid use case of pinning a buffer in GGTT, even when PPGTT is used (which is the reason invoked in the commit message).

Global OA buffers should be handled by the kernel and exposed through perf, imo. I think I'll go lalala on this a bit longer ...

Why? Because allowing the pin ioctl as root is such a problem? You need to come up with an alternative proposal and we need to get it implemented in some reasonable amount of time if we're not going to just do the simple thing that's already been shown to work...

IOW don't plug your ears and say "lalala" for too long.

Signature · 1 line
Jesse Barnes, Intel Open Source Technology Center
#4 lore raw
In reply to Daniel Vetter

Hi Daniel,

Quoted 8 lines · Daniel Vetter
Quoted 7 lines · Damien Lespiau

This reverts commit 02f6bcccf7c324115747aae2f0addd6af5d321cd.

The OA buffer can contain global data (in particular, not linked to a context or a single batch execution) about GPU events (eg. hw context switches, rc6 transitions, frequency changes, ...) and needs to be mapped to GGTT. The pin ioctl provided a way to do that.

Quoted 6 lines
Quoted 3 lines

Admittedly, this change broke what seems to be a valid use case of pinning a buffer in GGTT, even when PPGTT is used (which is the reason invoked in the commit message).

Global OA buffers should be handled by the kernel and exposed through perf, imo. I think I'll go lalala on this a bit longer ...

Do you think that we can unblock this now that we have somewhat of path forward with Rob Bragg's work? I'm still uneasy with a precedent where we break working applications and it takes a long time for us to revert the offending change?

Thanks!

Signature · 1 line
Damien
#5 lore raw
Quoted 15 lines · Damien Lespiau

Hi Daniel,

Quoted 12 lines · Daniel Vetter
Quoted 10 lines · Damien Lespiau

This reverts commit 02f6bcccf7c324115747aae2f0addd6af5d321cd.

The OA buffer can contain global data (in particular, not linked to a context or a single batch execution) about GPU events (eg. hw context switches, rc6 transitions, frequency changes, ...) and needs to be mapped to GGTT. The pin ioctl provided a way to do that.

Admittedly, this change broke what seems to be a valid use case of pinning a buffer in GGTT, even when PPGTT is used (which is the reason invoked in the commit message).

Quoted 7 lines
Quoted 2 lines

Global OA buffers should be handled by the kernel and exposed through perf, imo. I think I'll go lalala on this a bit longer ...

Do you think that we can unblock this now that we have somewhat of path forward with Rob Bragg's work? I'm still uneasy with a precedent where we break working applications and it takes a long time for us to revert the offending change?

I still consider pinning stuff behind the kernels back too evil. So if people want that I'd like to see the use-case and why we can't do this differently.

And I've never approved of the pin ioctl but really loudly complained about each occasion I've spotted, so I think the internal users just have to keep the pieces for a bit longer.
-Daniel

Signature · 3 lines
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
#6 lore raw
Quoted 7 lines · On Fri, Sep 19, 2014 Daniel Vetter wrote:

I still consider pinning stuff behind the kernels back too evil. So if people want that I'd like to see the use-case and why we can't do this differently.

And I've never approved of the pin ioctl but really loudly complained about each occasion I've spotted, so I think the internal users just have to keep the pieces for a bit longer.
-Daniel

Daniel. All that's being asked for is a re-instatement of the old mechanism until a better solution can be designed and implemented.

It may well be evil, but the mechanism was there, and was the only known way to handle the OA buffer, so why wouldn't someone use it ? You've broken userspace before you provided any alternative solution.

Please, let's revert this while a more elegant solution is designed, implemented, reviewed, re-implemented, reviewed again, and maybe one day merged.

Remember that it will take a while to filter down to people even after you merge any new solution to nightly, or even drm-next. If we have to wait for the new design, it's not likely to reach us until next year.

Can't we just agree that we're evil, but turn a blind eye while we're coaxed slowly back towards the light ?

Jon

maintainer
#7 lore raw
Quoted 19 lines · Jon
Quoted 7 lines · On Fri, Sep 19, 2014 Daniel Vetter wrote:

I still consider pinning stuff behind the kernels back too evil. So if people want that I'd like to see the use-case and why we can't do this differently.

And I've never approved of the pin ioctl but really loudly complained about each occasion I've spotted, so I think the internal users just have to keep the pieces for a bit longer.
-Daniel

Daniel. All that's being asked for is a re-instatement of the old mechanism until a better solution can be designed and implemented.

It may well be evil, but the mechanism was there, and was the only known way to handle the OA buffer, so why wouldn't someone use it ? You've broken userspace before you provided any alternative solution.

Please, let's revert this while a more elegant solution is designed, implemented, reviewed, re-implemented, reviewed again, and maybe one day merged.

Quoted 6 lines

Remember that it will take a while to filter down to people even after you merge any new solution to nightly, or even drm-next. If we have to wait for the new design, it's not likely to reach us until next year.

Can't we just agree that we're evil, but turn a blind eye while we're coaxed slowly back towards the light ?

I thought we had an agreement that no features that were specific to the non-open source userspace drivers would be merged to the kernel, due to security and maintenance concerns, i.e. exactly this concern, we now have to maintain an interface that we can't regression test in public.

Maybe next time who ever made the decision to force merge code will learn why its a bad idea.

Personally I don't think this interface should be put back in, unless Mesa/Beigenet/libva uses it, does it even have igt tests?

Dave.

#8 lore raw

Hi Dave,

Quoted 5 lines · Dave Airlie

I thought we had an agreement that no features that were specific to the non-open source userspace drivers would be merged to the kernel, due to security and maintenance concerns, i.e. exactly this concern, we now have to maintain an interface that we can't regression test in public.

Actually, the pin ioctl() has been here for quite some time, since the introduction of GEM, see:

http://lwn.net/Articles/283798/ section 8.2

That's why one side is arguing that it's not acceptable to break user-space (open or closed , it doesn't matter at this point).

Daniel is saying that's a legacy artefact and it shouldn't be used anymore, but breaking a user-space application is enough for me to at least suggest a revert.

HTH,

Signature · 1 line
Damien