* [PATCH 0/2] I915 GEM context updates
@ 2015-06-30 12:24 David Weinehall
2015-06-30 12:24 ` [PATCH 1/2] intel: Add get/set context parameter helpers David Weinehall
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: David Weinehall @ 2015-06-30 12:24 UTC (permalink / raw)
To: dri-devel
This patch contains a few minor updates related to
I915 GEM context.
David Weinehall (2):
intel: Add get/set context parameter helpers
Add the I915_CONTEXT_PARAM_NO_ZEROMAP parameter
include/drm/i915_drm.h | 1 +
intel/intel_bufmgr.h | 4 ++++
intel/intel_bufmgr_gem.c | 57 ++++++++++++++++++++++++++++++++++++++++++++++++
3 files changed, 62 insertions(+)
--
2.1.4
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 1/2] intel: Add get/set context parameter helpers
2015-06-30 12:24 [PATCH 0/2] I915 GEM context updates David Weinehall
@ 2015-06-30 12:24 ` David Weinehall
2015-06-30 12:24 ` [PATCH 2/2] Add the I915_CONTEXT_PARAM_NO_ZEROMAP parameter David Weinehall
2015-06-30 12:49 ` [PATCH 0/2] I915 GEM context updates Chris Wilson
2 siblings, 0 replies; 6+ messages in thread
From: David Weinehall @ 2015-06-30 12:24 UTC (permalink / raw)
To: dri-devel
Add helper functions to set/get GEM context parameters.
Signed-off-by: David Weinehall <david.weinehall@linux.intel.com>
---
intel/intel_bufmgr.h | 4 ++++
intel/intel_bufmgr_gem.c | 57 ++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 61 insertions(+)
diff --git a/intel/intel_bufmgr.h b/intel/intel_bufmgr.h
index 285919e4c40d..b9af2361735d 100644
--- a/intel/intel_bufmgr.h
+++ b/intel/intel_bufmgr.h
@@ -203,6 +203,10 @@ int drm_intel_gem_bo_wait(drm_intel_bo *bo, int64_t timeout_ns);
drm_intel_context *drm_intel_gem_context_create(drm_intel_bufmgr *bufmgr);
void drm_intel_gem_context_destroy(drm_intel_context *ctx);
+int drm_intel_gem_context_get_param(drm_intel_context *ctx,
+ uint64_t param, uint64_t *value);
+int drm_intel_gem_context_set_param(drm_intel_context *ctx,
+ uint64_t param, uint64_t value);
int drm_intel_gem_bo_context_exec(drm_intel_bo *bo, drm_intel_context *ctx,
int used, unsigned int flags);
diff --git a/intel/intel_bufmgr_gem.c b/intel/intel_bufmgr_gem.c
index 60c06fccfb20..2ac00cb3be3e 100644
--- a/intel/intel_bufmgr_gem.c
+++ b/intel/intel_bufmgr_gem.c
@@ -3326,6 +3326,63 @@ drm_intel_gem_context_destroy(drm_intel_context *ctx)
}
int
+drm_intel_gem_context_get_param(drm_intel_context *ctx,
+ uint64_t param, uint64_t *value)
+{
+ drm_intel_bufmgr_gem *bufmgr_gem;
+ struct drm_i915_gem_context_param ctx_param;
+ int ret;
+
+ if (ctx == NULL)
+ return -EINVAL;
+
+ memclear(ctx_param);
+
+ bufmgr_gem = (drm_intel_bufmgr_gem *)ctx->bufmgr;
+
+ ctx_param.ctx_id = ctx->ctx_id;
+ ctx_param.param = param;
+
+ ret = drmIoctl(bufmgr_gem->fd, DRM_IOCTL_I915_GEM_CONTEXT_GETPARAM,
+ ¶m);
+ if (ret != 0)
+ fprintf(stderr, "DRM_IOCTL_I915_GEM_CONTEXT_GETPARAM failed: %s\n",
+ strerror(errno));
+ else
+ *value = ctx_param.value;
+
+ return ret;
+}
+
+int
+drm_intel_gem_context_set_param(drm_intel_context *ctx,
+ uint64_t param, uint64_t value)
+{
+ drm_intel_bufmgr_gem *bufmgr_gem;
+ struct drm_i915_gem_context_param ctx_param;
+ int ret;
+
+ if (ctx == NULL)
+ return -EINVAL;
+
+ memclear(ctx_param);
+
+ bufmgr_gem = (drm_intel_bufmgr_gem *)ctx->bufmgr;
+
+ ctx_param.ctx_id = ctx->ctx_id;
+ ctx_param.param = param;
+ ctx_param.value = value;
+
+ ret = drmIoctl(bufmgr_gem->fd, DRM_IOCTL_I915_GEM_CONTEXT_SETPARAM,
+ ¶m);
+ if (ret != 0)
+ fprintf(stderr, "DRM_IOCTL_I915_GEM_CONTEXT_SETPARAM failed: %s\n",
+ strerror(errno));
+
+ return ret;
+}
+
+int
drm_intel_get_reset_stats(drm_intel_context *ctx,
uint32_t *reset_count,
uint32_t *active,
--
2.1.4
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 2/2] Add the I915_CONTEXT_PARAM_NO_ZEROMAP parameter
2015-06-30 12:24 [PATCH 0/2] I915 GEM context updates David Weinehall
2015-06-30 12:24 ` [PATCH 1/2] intel: Add get/set context parameter helpers David Weinehall
@ 2015-06-30 12:24 ` David Weinehall
2015-06-30 12:49 ` [PATCH 0/2] I915 GEM context updates Chris Wilson
2 siblings, 0 replies; 6+ messages in thread
From: David Weinehall @ 2015-06-30 12:24 UTC (permalink / raw)
To: dri-devel
A new parameter was recently added to the i915 GEM contexts.
Add its define to i915_drm.h.
Signed-off-by: David Weinehall <david.weinehall@linux.intel.com>
---
include/drm/i915_drm.h | 1 +
1 file changed, 1 insertion(+)
diff --git a/include/drm/i915_drm.h b/include/drm/i915_drm.h
index ded43b1cb117..a658d1cc367a 100644
--- a/include/drm/i915_drm.h
+++ b/include/drm/i915_drm.h
@@ -1101,6 +1101,7 @@ struct drm_i915_gem_context_param {
__u32 size;
__u64 param;
#define I915_CONTEXT_PARAM_BAN_PERIOD 0x1
+#define I915_CONTEXT_PARAM_NO_ZEROMAP 0x2
__u64 value;
};
--
2.1.4
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH 0/2] I915 GEM context updates
2015-06-30 12:24 [PATCH 0/2] I915 GEM context updates David Weinehall
2015-06-30 12:24 ` [PATCH 1/2] intel: Add get/set context parameter helpers David Weinehall
2015-06-30 12:24 ` [PATCH 2/2] Add the I915_CONTEXT_PARAM_NO_ZEROMAP parameter David Weinehall
@ 2015-06-30 12:49 ` Chris Wilson
[not found] ` <20150630130123.GT14570@boom>
2 siblings, 1 reply; 6+ messages in thread
From: Chris Wilson @ 2015-06-30 12:49 UTC (permalink / raw)
To: David Weinehall; +Cc: Daniel Vetter, dri-devel
On Tue, Jun 30, 2015 at 03:24:51PM +0300, David Weinehall wrote:
> This patch contains a few minor updates related to
> I915 GEM context.
As a kernel API, this is absolutely awful. Can we please correct it before
it is released?
-Chris
--
Chris Wilson, Intel Open Source Technology Centre
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 0/2] I915 GEM context updates
[not found] ` <20150701122144.GV14570@boom>
@ 2015-07-01 15:23 ` Daniel Vetter
2015-07-08 11:33 ` David Weinehall
0 siblings, 1 reply; 6+ messages in thread
From: Daniel Vetter @ 2015-07-01 15:23 UTC (permalink / raw)
To: David Weinehall; +Cc: intel-gfx
On Wed, Jul 1, 2015 at 2:21 PM, David Weinehall
<david.weinehall@linux.intel.com> wrote:
> On Tue, Jun 30, 2015 at 03:01:06PM +0100, Chris Wilson wrote:
>> On Tue, Jun 30, 2015 at 04:36:55PM +0300, David Weinehall wrote:
>> > On Tue, Jun 30, 2015 at 02:32:19PM +0100, Chris Wilson wrote:
>> > > On Tue, Jun 30, 2015 at 04:01:23PM +0300, David Weinehall wrote:
>> > > > On Tue, Jun 30, 2015 at 01:49:27PM +0100, Chris Wilson wrote:
>> > > > > On Tue, Jun 30, 2015 at 03:24:51PM +0300, David Weinehall wrote:
>> > > > > > This patch contains a few minor updates related to
>> > > > > > I915 GEM context.
>> > > > >
>> > > > > As a kernel API, this is absolutely awful. Can we please correct it before
>> > > > > it is released?
>> > > >
>> > > > Daniel has already merged it and didn't have any objections, so you'll
>> > > > have to convince him, not me.
>> > > >
>> > > > If you believe it's awful, feel free to provide a better implementation.
>> > >
>> > > As I recall, I did.
>> >
>> > Hmmm, I must've missed your patch -- if so I apologise. What was the
>> > title of the post, and how come Daniel hasn't merged that one instead?
>>
>> I gave details on a comment to your patch, where I thought the api could
>> be improved.
>
> Yeah, I got the bits about you not liking the approach, but the things
> you write in this e-mail are the first suggestions that I find concrete
> enough for me to actually know what you want instead.
Imo NONZEROMAP is still good to go, and good enough for
opencl/beignet. Allowing more fancy placement constraints might be
useful eventually, but thus far I haven't seen a compelling reason
really. Or not compelling enough at least.
And I don't think there's a point in blocking beignet for something
too fancy. Hence this still has my Ack. It gets the (really specific)
job done for beignet, which seems good enough.
-Daniel
--
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 0/2] I915 GEM context updates
2015-07-01 15:23 ` Daniel Vetter
@ 2015-07-08 11:33 ` David Weinehall
0 siblings, 0 replies; 6+ messages in thread
From: David Weinehall @ 2015-07-08 11:33 UTC (permalink / raw)
To: Daniel Vetter; +Cc: intel-gfx
On Wed, Jul 01, 2015 at 05:23:51PM +0200, Daniel Vetter wrote:
> On Wed, Jul 1, 2015 at 2:21 PM, David Weinehall
> <david.weinehall@linux.intel.com> wrote:
> > On Tue, Jun 30, 2015 at 03:01:06PM +0100, Chris Wilson wrote:
> >> On Tue, Jun 30, 2015 at 04:36:55PM +0300, David Weinehall wrote:
> >> > On Tue, Jun 30, 2015 at 02:32:19PM +0100, Chris Wilson wrote:
> >> > > On Tue, Jun 30, 2015 at 04:01:23PM +0300, David Weinehall wrote:
> >> > > > On Tue, Jun 30, 2015 at 01:49:27PM +0100, Chris Wilson wrote:
> >> > > > > On Tue, Jun 30, 2015 at 03:24:51PM +0300, David Weinehall wrote:
> >> > > > > > This patch contains a few minor updates related to
> >> > > > > > I915 GEM context.
> >> > > > >
> >> > > > > As a kernel API, this is absolutely awful. Can we please correct it before
> >> > > > > it is released?
> >> > > >
> >> > > > Daniel has already merged it and didn't have any objections, so you'll
> >> > > > have to convince him, not me.
> >> > > >
> >> > > > If you believe it's awful, feel free to provide a better implementation.
> >> > >
> >> > > As I recall, I did.
> >> >
> >> > Hmmm, I must've missed your patch -- if so I apologise. What was the
> >> > title of the post, and how come Daniel hasn't merged that one instead?
> >>
> >> I gave details on a comment to your patch, where I thought the api could
> >> be improved.
> >
> > Yeah, I got the bits about you not liking the approach, but the things
> > you write in this e-mail are the first suggestions that I find concrete
> > enough for me to actually know what you want instead.
>
> Imo NONZEROMAP is still good to go, and good enough for
> opencl/beignet. Allowing more fancy placement constraints might be
> useful eventually, but thus far I haven't seen a compelling reason
> really. Or not compelling enough at least.
>
> And I don't think there's a point in blocking beignet for something
> too fancy. Hence this still has my Ack. It gets the (really specific)
> job done for beignet, which seems good enough.
OK, so where do we stand on this? Daniel is OK with the patch (and has
merged the kernel side). The last post regarding this on the libdrm
list is that Chris objects, meaning that no one is likely to pick up
that patch and merge it to libdrm, meaning it's dead in the water until
a follow-up comment.
Regards, David
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2015-07-08 11:34 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-06-30 12:24 [PATCH 0/2] I915 GEM context updates David Weinehall
2015-06-30 12:24 ` [PATCH 1/2] intel: Add get/set context parameter helpers David Weinehall
2015-06-30 12:24 ` [PATCH 2/2] Add the I915_CONTEXT_PARAM_NO_ZEROMAP parameter David Weinehall
2015-06-30 12:49 ` [PATCH 0/2] I915 GEM context updates Chris Wilson
[not found] ` <20150630130123.GT14570@boom>
[not found] ` <20150630133219.GT1381@nuc-i3427.alporthouse.com>
[not found] ` <20150630133655.GU14570@boom>
[not found] ` <20150630140106.GW1381@nuc-i3427.alporthouse.com>
[not found] ` <20150701122144.GV14570@boom>
2015-07-01 15:23 ` Daniel Vetter
2015-07-08 11:33 ` David Weinehall
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.