Add uAPI to support ICL VME hardware for new media-driver
Subsystems (3)
Joonas Lahtinen
maintainercover Add uAPI to support ICL VME hardware for new media-driver
Hi all,
I would like to have some Acked-by's from you, the distro media folks Cc'd here, to document your intent to start using Intel's new media driver[1]. So if you recognize yourself (or are otherwise interested), please read on.
TL;DR Distro folks, please give your Acked-by on patch [5/6]
I believe most are already aware of the situation that Intel is moving to the new codebase for libva backend to support new Intel integrated graphics devices. The existing intel-libva-driver will be continue to be be supported for pre-Icelake platforms (<Gen11). Icelake and further platforms will only be supported from the new codebase.
There's the complication that some Icelake features of the new driver will require new kernel uAPIs to work... But the new driver has not yet been well-established in the community from perspective of fulfilling [2]. This is very much due to the demand being low as Icelake is not widely available yet. So it's bit of a chicken and egg problem as we have a new platform *and* a new codebase for it simultaneously.
Ahead of that community adoption, to ensure that Icelake has good kernel support from day one, we'd like to merge kernel support for the parts that have functional effect (this series). This is to avoid the scenario where end users have to update their distro kernels, like happened with Skylake.
So if I could get Acked-by's from distro folks on the patch [5/6] that adds the new uAPI. That would document their intent to become an active user of the media-driver[1]. If that happens in the next week or two, it would mean that Icelake hardware features would be supported in kernel version 5.1 fully from kernel driver point of view.
The new uAPI is needed to make VME feature functionally work on Icelake. It's pretty much a simple enable/disable switch for hardware configuration that only includes hardware slices compatible with the VME workload. So it's currently limited to the required on/off choice to keep things straightforward. The uAPI can be extended in the future for possible performance gains for more fine-grained control.
VME is shared function to handle motion estimation. One intended usercase is in Hierarchical Motion Estimation (HME) media kernel. It provides a bigger search range with reduced cost for the search. HME should improve the encode quality with scenarios where the video has a lot of motion in it. Carl (Cc'd) can provide more details if needed.
The respective IGT tests are reviewed and can be found at:
https://patchwork.freedesktop.org/series/49190/
The userspace changes are reviewed and rebased here:
https://github.com/intel/media-driver/pull/271
https://github.com/intel/media-driver/pull/463
Best Regards, Joonas Lahtinen
PS. This series might result in some CI failures reported as it adds new uAPI
and Patchwork / CI synchronization of tests and kernel is currently WIP.
[1] https://github.com/intel/media-driver
[2] https://01.org/linuxgraphics/gfx-docs/drm/gpu/drm-uapi.html#open-source-userspace-requirements
Lionel Landwerlin (2):
drm/i915: Record the sseu configuration per-context & engine drm/i915/perf: lock powergating configuration to default when active
Tvrtko Ursulin (4):
drm/i915/execlists: Move RPCS setup to context pin drm/i915: Add timeline barrier support
drm/i915: Expose RPCS (SSEU) configuration to userspace (Gen11 only) drm/i915/selftests: Context SSEU reconfiguration tests
drivers/gpu/drm/i915/i915_drv.h | 14 + drivers/gpu/drm/i915/i915_gem_context.c | 354 ++++++++++++- drivers/gpu/drm/i915/i915_gem_context.h | 10 + drivers/gpu/drm/i915/i915_perf.c | 13 +- drivers/gpu/drm/i915/i915_request.c | 13 + drivers/gpu/drm/i915/i915_request.h | 10 + drivers/gpu/drm/i915/i915_timeline.c | 3 + drivers/gpu/drm/i915/i915_timeline.h | 27 + drivers/gpu/drm/i915/intel_lrc.c | 100 ++-- drivers/gpu/drm/i915/intel_lrc.h | 2 + .../gpu/drm/i915/selftests/i915_gem_context.c | 481 ++++++++++++++++++ .../gpu/drm/i915/selftests/mock_timeline.c | 2 + include/uapi/drm/i915_drm.h | 64 +++ 13 files changed, 1056 insertions(+), 37 deletions(-)
Signature · 6 lines
2.17.2 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Joonas Lahtinen
maintainerPATCH 1/6 drm/i915/execlists: Move RPCS setup to context pin
From: Tvrtko Ursulin <[email protected]>
Configuring RPCS in context image just before pin is sufficient and will come extra handy in one of the following patches.
v2:
* Split image setup a bit differently. (Chris Wilson)
v3:
* Update context image after reset as well - otherwise the application of pinned default state clears the RPCS.
v4:
* Use local variable throughout the function. (Chris Wilson)
--- drivers/gpu/drm/i915/intel_lrc.c | 45 ++++++++++++++++++++------------ 1 file changed, 28 insertions(+), 17 deletions(-)
drivers/gpu/drm/i915/intel_lrc.c +28 -17
@@ -1169,6 +1169,24 @@ static int __context_pin(struct i915_gem_context *ctx, struct i915_vma *vma)return i915_vma_pin (vma,0 ,0 , flags); } +static u32 make_rpcs (struct drm_i915_private *dev_priv); + +static void +__execlists_update_reg_state (struct intel_engine_cs *engine, +struct intel_context *ce) +{ +u32 *regs = ce->lrc_reg_state; +struct intel_ring *ring = ce->ring; + + regs[CTX_RING_BUFFER_START +1 ] =i915_ggtt_offset (ring->vma); + regs[CTX_RING_HEAD +1 ] = ring->head; + regs[CTX_RING_TAIL +1 ] = ring->tail; + +/* RPCS */ +if (engine->class ==RENDER_CLASS ) + regs[CTX_R_PWR_CLK_STATE +1 ] =make_rpcs (engine->i915); +} +static struct intel_context * __execlists_context_pin(struct intel_engine_cs *engine, struct i915_gem_context *ctx,
@@ -1207,10 +1225,8 @@ __execlists_context_pin(struct intel_engine_cs *engine,GEM_BUG_ON (!intel_ring_offset_valid (ce->ring, ce->ring->head)); ce->lrc_reg_state = vaddr +LRC_STATE_PN *PAGE_SIZE ; - ce->lrc_reg_state[CTX_RING_BUFFER_START +1 ] = -i915_ggtt_offset (ce->ring->vma); - ce->lrc_reg_state[CTX_RING_HEAD +1 ] = ce->ring->head; - ce->lrc_reg_state[CTX_RING_TAIL +1 ] = ce->ring->tail; + +__execlists_update_reg_state (engine, ce); ce->state->obj->pin_global++;i915_gem_context_get (ctx);
@@ -1834,14 +1850,14 @@ static void execlists_reset(struct intel_engine_cs *engine, engine->pinned_default_state +LRC_STATE_PN *PAGE_SIZE , engine->context_size - PAGE_SIZE); } -execlists_init_reg_state (regs, - request->gem_context, engine, request->ring);/* Move the RING_HEAD onto the breadcrumb, past the hanging batch */ - regs[CTX_RING_BUFFER_START +1 ] =i915_ggtt_offset (request->ring->vma); - request->ring->head =intel_ring_wrap (request->ring, request->postfix); - regs[CTX_RING_HEAD +1 ] = request->ring->head; + +execlists_init_reg_state (regs, request->gem_context, engine, + request->ring); + +__execlists_update_reg_state (engine, request->hw_context);intel_ring_update_space (request->ring);
@@ -2530,8 +2546,7 @@ static void execlists_init_reg_state(u32 *regs,if (rcs) { regs[CTX_LRI_HEADER_2 ] =MI_LOAD_REGISTER_IMM (1 ); -CTX_REG (regs,CTX_R_PWR_CLK_STATE ,GEN8_R_PWR_CLK_STATE , -make_rpcs (dev_priv)); +CTX_REG (regs,CTX_R_PWR_CLK_STATE ,GEN8_R_PWR_CLK_STATE ,0 );i915_oa_init_reg_state (engine, ctx, regs); }
@@ -2692,12 +2707,8 @@ void intel_lr_context_resume(struct drm_i915_private *i915)intel_ring_reset (ce->ring,0 ); -if (ce->pin_count) {/* otherwise done in context_pin */ -u32 *regs = ce->lrc_reg_state; - - regs[CTX_RING_HEAD +1 ] = ce->ring->head; - regs[CTX_RING_TAIL +1 ] = ce->ring->tail; - } +if (ce->pin_count)/* otherwise done in context_pin */ +__execlists_update_reg_state (engine, ce); } } }
Signature · 6 lines
2.17.2 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Joonas Lahtinen
maintainerPATCH 2/6 drm/i915: Record the sseu configuration per-context & engine
In reply to Joonas LahtinenFrom: Lionel Landwerlin <[email protected]>
We want to expose the ability to reconfigure the slices, subslice and eu per context and per engine. To facilitate that, store the current configuration on the context for each engine, which is initially set to the device default upon creation.
v2: record sseu configuration per context & engine (Chris)
v3: introduce the i915_gem_context_sseu to store powergating
programming, sseu_dev_info has grown quite a bit (Lionel)
v4: rename i915_gem_sseu into intel_sseu (Chris)
use to_intel_context() (Chris)
v5: More to_intel_context() (Tvrtko)
Switch intel_sseu from union to struct (Tvrtko) Move context default sseu in existing loop (Chris)
v6: s/intel_sseu_from_device_sseu/intel_device_default_sseu/ (Tvrtko)
Tvrtko Ursulin:
v7:
* Pass intel_sseu by pointer instead of value to make_rpcs.
* Rebase for make_rpcs changes.
v8:
* Rebase for RPCS edit on pin.
v9:
* Rebase for context image setup changes.
v10:
* Rename dev_priv to i915. (Chris Wilson)
v11:
* Rebase.
v12:
* Rebase for IS_GEN changes.
v13:
* Rebase for RUNTIME_INFO.
--- drivers/gpu/drm/i915/i915_drv.h | 14 +++++++++++ drivers/gpu/drm/i915/i915_gem_context.c | 2 ++ drivers/gpu/drm/i915/i915_gem_context.h | 4 ++++ drivers/gpu/drm/i915/i915_request.h | 10 ++++++++ drivers/gpu/drm/i915/intel_lrc.c | 31 +++++++++++++------------ 5 files changed, 46 insertions(+), 15 deletions(-)
drivers/gpu/drm/i915/i915_drv.h +14 -0
@@ -3331,6 +3331,20 @@ mkwrite_device_info(struct drm_i915_private *dev_priv)return (struct intel_device_info *)INTEL_INFO (dev_priv); } +static inline struct intel_sseu +intel_device_default_sseu (struct drm_i915_private *i915) +{ +const struct sseu_dev_info *sseu = &RUNTIME_INFO (i915)->sseu; +struct intel_sseu value = { + .slice_mask = sseu->slice_mask, + .subslice_mask = sseu->subslice_mask[0 ], + .min_eus_per_subslice = sseu->max_eus_per_subslice, + .max_eus_per_subslice = sseu->max_eus_per_subslice, + }; + +return value; +} +/* modesetting */ extern void intel_modeset_init_hw (struct drm_device *dev);extern int intel_modeset_init (struct drm_device *dev);
drivers/gpu/drm/i915/i915_gem_context.c +2 -0
@@ -342,6 +342,8 @@ __create_hw_context(struct drm_i915_private *dev_priv,struct intel_context *ce = &ctx->__engine[n]; ce->gem_context = ctx; +/* Use the whole device by default */ + ce->sseu =intel_device_default_sseu (dev_priv); }INIT_RADIX_TREE (&ctx->handles_vma,GFP_KERNEL );
drivers/gpu/drm/i915/i915_gem_context.h +4 -0
@@ -31,6 +31,7 @@#include "i915_gem.h" #include "i915_scheduler.h" +#include "intel_device_info.h" struct pid ;
@@ -171,6 +172,9 @@ struct i915_gem_context {int pin_count;const struct intel_context_ops *ops; + +/** sseu: Control eu/slice partitioning */ +struct intel_sseu sseu; } __engine[I915_NUM_ENGINES ];/** ring_size: size for allocating the per-engine ring buffer */
drivers/gpu/drm/i915/i915_request.h +10 -0
@@ -38,6 +38,16 @@ struct drm_i915_gem_object;struct i915_request ;struct i915_timeline ; +/* +* Powergating configuration for a particular (context,engine). +*/ +struct intel_sseu { +u8 slice_mask; +u8 subslice_mask; +u8 min_eus_per_subslice; +u8 max_eus_per_subslice; +}; +struct intel_wait {struct rb_node node;struct task_struct *tsk;
drivers/gpu/drm/i915/intel_lrc.c +16 -15
@@ -1169,7 +1169,8 @@ static int __context_pin(struct i915_gem_context *ctx, struct i915_vma *vma)return i915_vma_pin (vma,0 ,0 , flags); } -static u32 make_rpcs (struct drm_i915_private *dev_priv); +static u32 +make_rpcs (struct drm_i915_private *i915,struct intel_sseu *ctx_sseu); static void __execlists_update_reg_state(struct intel_engine_cs *engine,
@@ -1184,7 +1185,8 @@ __execlists_update_reg_state(struct intel_engine_cs *engine,/* RPCS */ if (engine->class ==RENDER_CLASS ) - regs[CTX_R_PWR_CLK_STATE +1 ] =make_rpcs (engine->i915); + regs[CTX_R_PWR_CLK_STATE +1 ] =make_rpcs (engine->i915, + &ce->sseu); } static struct intel_context *
@@ -2322,18 +2324,19 @@ int logical_xcs_ring_init(struct intel_engine_cs *engine) }static u32 -make_rpcs (struct drm_i915_private *dev_priv) +make_rpcs (struct drm_i915_private *i915,struct intel_sseu *ctx_sseu) { -bool subslice_pg =RUNTIME_INFO (dev_priv)->sseu.has_subslice_pg; -u8 slices =hweight8 (RUNTIME_INFO (dev_priv)->sseu.slice_mask); -u8 subslices =hweight8 (RUNTIME_INFO (dev_priv)->sseu.subslice_mask[0 ]); +const struct sseu_dev_info *sseu = &RUNTIME_INFO (i915)->sseu; +bool subslice_pg = sseu->has_subslice_pg; +u8 slices =hweight8 (ctx_sseu->slice_mask); +u8 subslices =hweight8 (ctx_sseu->subslice_mask);u32 rpcs =0 ;/* * No explicit RPCS request is needed to ensure full * slice/subslice/EU enablement prior to Gen9. */ -if (INTEL_GEN (dev_priv) <9 ) +if (INTEL_GEN (i915) <9 )return 0 ;/*
@@ -2361,7 +2364,7 @@ make_rpcs(struct drm_i915_private *dev_priv)* subslices are enabled, or a count between one and four on the first * slice. */ -if (IS_GEN (dev_priv,11 ) && slices ==1 && subslices >=4 ) { +if (IS_GEN (i915,11 ) && slices ==1 && subslices >=4 ) {GEM_BUG_ON (subslices &1 ); subslice_pg = false;
@@ -2374,10 +2377,10 @@ make_rpcs(struct drm_i915_private *dev_priv)* must make an explicit request through RPCS for full * enablement. */ -if (RUNTIME_INFO (dev_priv)->sseu.has_slice_pg) { +if (sseu->has_slice_pg) {u32 mask, val = slices; -if (INTEL_GEN (dev_priv) >=11 ) { +if (INTEL_GEN (i915) >=11 ) { mask =GEN11_RPCS_S_CNT_MASK ; val <<=GEN11_RPCS_S_CNT_SHIFT ; }else {
@@ -2402,18 +2405,16 @@ make_rpcs(struct drm_i915_private *dev_priv) rpcs |=GEN8_RPCS_ENABLE |GEN8_RPCS_SS_CNT_ENABLE | val; } -if (RUNTIME_INFO (dev_priv)->sseu.has_eu_pg) { +if (sseu->has_eu_pg) {u32 val; - val =RUNTIME_INFO (dev_priv)->sseu.eu_per_subslice << -GEN8_RPCS_EU_MIN_SHIFT ; + val = ctx_sseu->min_eus_per_subslice <<GEN8_RPCS_EU_MIN_SHIFT ;GEM_BUG_ON (val & ~GEN8_RPCS_EU_MIN_MASK ); val &=GEN8_RPCS_EU_MIN_MASK ; rpcs |= val; - val =RUNTIME_INFO (dev_priv)->sseu.eu_per_subslice << -GEN8_RPCS_EU_MAX_SHIFT ; + val = ctx_sseu->max_eus_per_subslice <<GEN8_RPCS_EU_MAX_SHIFT ;GEM_BUG_ON (val & ~GEN8_RPCS_EU_MAX_MASK ); val &=GEN8_RPCS_EU_MAX_MASK ;
Signature · 6 lines
2.17.2 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Joonas Lahtinen
maintainerPATCH 3/6 drm/i915/perf: lock powergating configuration to default when active
In reply to Joonas LahtinenFrom: Lionel Landwerlin <[email protected]>
If some of the contexts submitting workloads to the GPU have been configured to shutdown slices/subslices, we might loose the NOA configurations written in the NOA muxes.
One possible solution to this problem is to reprogram the NOA muxes when we switch to a new context. We initially tried this in the workaround batchbuffer but some concerns where raised about the cost of reprogramming at every context switch. This solution is also not without consequences from the userspace point of view. Reprogramming of the muxes can only happen once the powergating configuration has changed (which happens after context switch). This means for a window of time during the recording, counters recorded by the OA unit might be invalid. This requires userspace dealing with OA reports to discard the invalid values.
Minimizing the reprogramming could be implemented by tracking of the last programmed configuration somewhere in GGTT and use MI_PREDICATE to discard some of the programming commands, but the command streamer would still have to parse all the MI_LRI instructions in the workaround batchbuffer.
Another solution, which this change implements, is to simply disregard the user requested configuration for the period of time when i915/perf is active.
On most platforms there are no issues with this apart from a performance penality for some media workloads that benefit from running on a partially powergated GPU. We already prevent RC6 from affecting the programming so it doesn't sound completely unreasonable to hold on powergating for the same reason.
On Icelake however there would a functional problem if the slices not- containing the VME block were left enabled with a running media workload which explicitly disabled them. To avoid a GPU hang in this case, on Icelake we lock the enablement to only slices which contain VME blocks. Downside is that it means degraded GPU performance when OA is active but there is no known alternative solution for this.
v2: Leave RPCS programming in intel_lrc.c (Lionel)
v3: Update for s/union intel_sseu/struct intel_sseu/ (Lionel)
More to_intel_context() (Tvrtko) s/dev_priv/i915/ (Tvrtko)
Tvrtko Ursulin:
v4:
* Rebase for make_rpcs changes.
v5:
* Apply OA restriction from make_rpcs directly.
v6:
* Rebase for context image setup changes.
v7:
* Move stream assignment before metric enable.
v8-9:
* Rebase.
v10:
* Squashed with ICL support patch.
Bspec: 21140
--- drivers/gpu/drm/i915/i915_perf.c | 13 ++++++--- drivers/gpu/drm/i915/intel_lrc.c | 46 ++++++++++++++++++++++++-------- drivers/gpu/drm/i915/intel_lrc.h | 2 ++ 3 files changed, 46 insertions(+), 15 deletions(-)
drivers/gpu/drm/i915/i915_perf.c +9 -4
@@ -1677,6 +1677,11 @@ static void gen8_update_reg_state_unlocked(struct i915_gem_context *ctx,CTX_REG (reg_state, state_offset, flex_regs[i], value); } + +CTX_REG (reg_state,CTX_R_PWR_CLK_STATE ,GEN8_R_PWR_CLK_STATE , +gen8_make_rpcs (dev_priv, + &to_intel_context (ctx, + dev_priv->engine[RCS ])->sseu)); }/*
@@ -2098,21 +2103,21 @@ static int i915_oa_stream_init(struct i915_perf_stream *stream,if (ret) goto err_lock; + stream->ops = &i915_oa_stream_ops; + dev_priv->perf.oa.exclusive_stream = stream; + ret = dev_priv->perf.oa.ops.enable_metric_set (stream);if (ret) {DRM_DEBUG ("Unable to enable metric set\n" ); goto err_enable; } - stream->ops = &i915_oa_stream_ops; - - dev_priv->perf.oa.exclusive_stream = stream; -mutex_unlock (&dev_priv->drm.struct_mutex);return 0 ; err_enable: + dev_priv->perf.oa.exclusive_stream =NULL ; dev_priv->perf.oa.ops.disable_metric_set (dev_priv);mutex_unlock (&dev_priv->drm.struct_mutex);
drivers/gpu/drm/i915/intel_lrc.c +35 -11
84 lines not on this page · raw message
drivers/gpu/drm/i915/intel_lrc.h +2 -0
@@ -104,4 +104,6 @@ void intel_lr_context_resume(struct drm_i915_private *dev_priv);void intel_execlists_set_default_submission (struct intel_engine_cs *engine); +u32 gen8_make_rpcs (struct drm_i915_private *i915,struct intel_sseu *ctx_sseu); +#endif /* _INTEL_LRC_H_ */
Signature · 6 lines
2.17.2 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Joonas Lahtinen
maintainerPATCH 4/6 drm/i915: Add timeline barrier support
In reply to Joonas LahtinenFrom: Tvrtko Ursulin <[email protected]>
Timeline barrier allows serialization between different timelines.
After calling i915_timeline_set_barrier with a request, all following submissions on this timeline will be set up as depending on this request, or barrier. Once the barrier has been completed it automatically gets cleared and things continue as normal.
This facility will be used by the upcoming context SSEU code.
v2:
* Assert barrier has been retired on timeline_fini. (Chris Wilson)
* Fix mock_timeline.
v3:
* Improved comment language. (Chris Wilson)
--- drivers/gpu/drm/i915/i915_request.c | 13 +++++++++ drivers/gpu/drm/i915/i915_timeline.c | 3 +++ drivers/gpu/drm/i915/i915_timeline.h | 27 +++++++++++++++++++ .../gpu/drm/i915/selftests/mock_timeline.c | 2 ++ 4 files changed, 45 insertions(+)
drivers/gpu/drm/i915/i915_request.c +13 -0
@@ -509,6 +509,15 @@ i915_request_alloc_slow(struct intel_context *ce)return kmem_cache_alloc (ce->gem_context->i915->requests,GFP_KERNEL ); } +static int add_timeline_barrier (struct i915_request *rq) +{ +struct i915_request *barrier = +i915_gem_active_raw (&rq->timeline->barrier, + &rq->i915->drm.struct_mutex); + +return barrier ?i915_request_await_dma_fence (rq, &barrier->fence) :0 ; +} +/** * i915_request_alloc - allocate a request structure *
@@ -652,6 +661,10 @@ i915_request_alloc(struct intel_engine_cs *engine, struct i915_gem_context *ctx)*/ rq->head = rq->ring->emit; + ret =add_timeline_barrier (rq); +if (ret) + goto err_unwind; + ret = engine->request_alloc (rq);if (ret) goto err_unwind;
drivers/gpu/drm/i915/i915_timeline.c +3 -0
@@ -37,6 +37,8 @@ void i915_timeline_init(struct drm_i915_private *i915,INIT_LIST_HEAD (&timeline->requests);i915_syncmap_init (&timeline->sync); + +init_request_active (&timeline->barrier,NULL ); }/**
@@ -69,6 +71,7 @@ void i915_timelines_park(struct drm_i915_private *i915)void i915_timeline_fini (struct i915_timeline *timeline) {GEM_BUG_ON (!list_empty (&timeline->requests)); +GEM_BUG_ON (i915_gem_active_isset (&timeline->barrier));i915_syncmap_free (&timeline->sync);
drivers/gpu/drm/i915/i915_timeline.h +27 -0
@@ -64,6 +64,16 @@ struct i915_timeline {*/ struct i915_syncmap *sync; +/** +* Barrier provides the ability to serialize ordering between different +* timelines. +* +* Users can call i915_timeline_set_barrier which will make all +* subsequent submissions to this timeline be executed only after the +* barrier has been completed. +*/ +struct i915_gem_active barrier; +struct list_head link;const char *name;
@@ -136,4 +146,21 @@ static inline bool i915_timeline_sync_is_later(struct i915_timeline *tl,void i915_timelines_park (struct drm_i915_private *i915); +/** +* i915_timeline_set_barrier - orders submission between different timelines +* @timeline: timeline to set the barrier on +* @rq: request after which new submissions can proceed +* +* Sets the passed in request as the serialization point for all subsequent +* submissions on @timeline. Subsequent requests will not be submitted to GPU +* until the barrier has been completed. +*/ +static inline void +i915_timeline_set_barrier (struct i915_timeline *timeline, +struct i915_request *rq) +{ +GEM_BUG_ON (timeline->fence_context == rq->timeline->fence_context); +i915_gem_active_set (&timeline->barrier, rq); +} +#endif
drivers/gpu/drm/i915/selftests/mock_timeline.c +2 -0
@@ -19,6 +19,8 @@ void mock_timeline_init(struct i915_timeline *timeline, u64 context)i915_syncmap_init (&timeline->sync); +init_request_active (&timeline->barrier,NULL ); +INIT_LIST_HEAD (&timeline->link); }
Signature · 6 lines
2.17.2 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Joonas Lahtinen
maintainerPATCH 5/6 drm/i915: Expose RPCS (SSEU) configuration to userspace (Gen11 only)
In reply to Joonas LahtinenFrom: Tvrtko Ursulin <[email protected]>
We want to allow userspace to reconfigure the subslice configuration on a per context basis.
This is required for the functional requirement of shutting down non-VME enabled sub-slices on Gen11 parts.
To do so, we expose a context parameter to allow adjustment of the RPCS register stored within the context image (and currently not accessible via LRI).
If the context is adjusted before first use or whilst idle, the adjustment is for "free"; otherwise if the context is active we queue a request to do so (using the kernel context), following all other activity by that context, which is also marked as barrier for all following submission against the same context.
Since the overhead of device re-configuration during context switching can be significant, especially in multi-context workloads, we limit this new uAPI to only support the Gen11 VME use case. In this use case either the device is fully enabled, and exactly one slice and half of the subslices are enabled.
Example usage:
struct drm_i915_gem_context_param_sseu sseu = { };
struct drm_i915_gem_context_param arg =
{ .param = I915_CONTEXT_PARAM_SSEU,
.ctx_id = gem_context_create(fd),
.size = sizeof(sseu),
.value = to_user_pointer(&sseu)
};
/* Query device defaults. */
gem_context_get_param(fd, &arg);
/* Set VME configuration on a 1x6x8 part. */
sseu.slice_mask = 0x1;
sseu.subslice_mask = 0xe0;
gem_context_set_param(fd, &arg);v2: Fix offset of CTX_R_PWR_CLK_STATE in intel_lr_context_set_sseu() (Lionel)
v3: Add ability to program this per engine (Chris)
v4: Move most get_sseu() into i915_gem_context.c (Lionel)
v5: Validate sseu configuration against the device's capabilities (Lionel)
v6: Change context powergating settings through MI_SDM on kernel context (Chris)
v7: Synchronize the requests following a powergating setting change using a global
dependency (Chris)
Iterate timelines through dev_priv.gt.active_rings (Tvrtko) Disable RPCS configuration setting for non capable users (Lionel/Tvrtko)
v8: s/union intel_sseu/struct intel_sseu/ (Lionel)
s/dev_priv/i915/ (Tvrtko)
Change uapi class/instance fields to u16 (Tvrtko) Bump mask fields to 64bits (Lionel)
Don't return EPERM when dynamic sseu is disabled (Tvrtko)
v9: Import context image into kernel context's ppgtt only when
reconfiguring powergated slice/subslices (Chris) Use aliasing ppgtt when needed (Michel)
Tvrtko Ursulin:
v10:
* Update for upstream changes.
* Request submit needs a RPM reference.
* Reject on !FULL_PPGTT for simplicity.
* Pull out get/set param to helpers for readability and less indent.
* Use i915_request_await_dma_fence in add_global_barrier to skip waits on the same timeline and avoid GEM_BUG_ON.
* No need to explicitly assign a NULL pointer to engine in legacy mode.
* No need to move gen8_make_rpcs up.
* Factored out global barrier as prep patch.
* Allow to only CAP_SYS_ADMIN if !Gen11.
v11:
* Remove engine vfunc in favour of local helper. (Chris Wilson)
* Stop retiring requests before updates since it is not needed (Chris Wilson)
* Implement direct CPU update path for idle contexts. (Chris Wilson)
* Left side dependency needs only be on the same context timeline. (Chris Wilson)
* It is sufficient to order the timeline. (Chris Wilson)
* Reject !RCS configuration attempts with -ENODEV for now.
v12:
* Rebase for make_rpcs.
v13:
* Centralize SSEU normalization to make_rpcs.
* Type width checking (uAPI <-> implementation).
* Gen11 restrictions uAPI checks.
* Gen11 subslice count differences handling.
Chris Wilson:
* args->size handling fixes.
* Update context image from GGTT.
* Postpone context image update to pinning.
* Use i915_gem_active_raw instead of last_request_on_engine.
v14:
* Add activity tracker on intel_context to fix the lifetime issues and simplify the code. (Chris Wilson)
v15:
* Fix context pin leak if no space in ring by simplifying the context pinning sequence.
v16:
* Rebase for context get/set param locking changes.
* Just -ENODEV on !Gen11. (Joonas)
v17:
* Fix one Gen11 subslice enablement rule.
* Handle error from i915_sw_fence_await_sw_fence_gfp. (Chris Wilson)
v18:
* Update commit message. (Joonas)
* Restrict uAPI to VME use case. (Joonas)
v19:
* Rebase.
v20:
* Rebase for ce->active_tracker.
v21:
* Rebase for IS_GEN changes.
v22:
* Reserve uAPI for flags straight away. (Chris Wilson)
v23:
* Rebase for RUNTIME_INFO.
v24:
* Added some headline docs for the uapi usage. (Joonas/Chris)
v25:
* Renamed class/instance to engine_class/engine_instance to avoid clash with C++ keyword. (Tony Ye)
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=100899
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=107634
Issue: https://github.com/intel/media-driver/issues/267
--- drivers/gpu/drm/i915/i915_gem_context.c | 341 +++++++++++++++++++++++- drivers/gpu/drm/i915/i915_gem_context.h | 6 + drivers/gpu/drm/i915/intel_lrc.c | 4 +- include/uapi/drm/i915_drm.h | 64 +++++ 4 files changed, 412 insertions(+), 3 deletions(-)
drivers/gpu/drm/i915/i915_gem_context.c +339 -2
@@ -89,6 +89,7 @@#include <drm/i915_drm.h> #include "i915_drv.h" #include "i915_trace.h" +#include "intel_lrc_reg.h" #include "intel_workarounds.h" #define ALL_L3_SLICES (dev) (1 << NUM_L3_SLICES(dev)) - 1
@@ -321,6 +322,15 @@ static u32 default_desc_template(const struct drm_i915_private *i915,return desc; } +static void intel_context_retire (struct i915_gem_active *active, +struct i915_request *rq) +{ +struct intel_context *ce = +container_of (active,typeof (*ce), active_tracker); + +intel_context_unpin (ce); +} +static struct i915_gem_context *__create_hw_context (struct drm_i915_private *dev_priv,struct drm_i915_file_private *file_priv)
@@ -344,6 +354,8 @@ __create_hw_context(struct drm_i915_private *dev_priv, ce->gem_context = ctx;/* Use the whole device by default */ ce->sseu =intel_device_default_sseu (dev_priv); + +init_request_active (&ce->active_tracker, intel_context_retire); }INIT_RADIX_TREE (&ctx->handles_vma,GFP_KERNEL );
@@ -841,6 +853,56 @@ int i915_gem_context_destroy_ioctl(struct drm_device *dev, void *data,return 0 ; } +static int get_sseu (struct i915_gem_context *ctx, +struct drm_i915_gem_context_param *args) +{ +struct drm_i915_gem_context_param_sseu user_sseu; +struct intel_engine_cs *engine; +struct intel_context *ce; +int ret; + +if (args->size ==0 ) + goto out; +else if (args->size <sizeof (user_sseu)) +return -EINVAL ; + +if (copy_from_user (&user_sseu,u64_to_user_ptr (args->value), +sizeof (user_sseu))) +return -EFAULT ; + +if (user_sseu.flags || user_sseu.rsvd) +return -EINVAL ; + + engine =intel_engine_lookup_user (ctx->i915, + user_sseu.engine_class, + user_sseu.engine_instance); +if (!engine) +return -EINVAL ; + +/* Only use for mutex here is to serialize get_param and set_param. */ + ret =mutex_lock_interruptible (&ctx->i915->drm.struct_mutex); +if (ret) +return ret; + + ce =to_intel_context (ctx, engine); + + user_sseu.slice_mask = ce->sseu.slice_mask; + user_sseu.subslice_mask = ce->sseu.subslice_mask; + user_sseu.min_eus_per_subslice = ce->sseu.min_eus_per_subslice; + user_sseu.max_eus_per_subslice = ce->sseu.max_eus_per_subslice; + +mutex_unlock (&ctx->i915->drm.struct_mutex); + +if (copy_to_user (u64_to_user_ptr (args->value), &user_sseu, +sizeof (user_sseu))) +return -EFAULT ; + +out: + args->size =sizeof (user_sseu); + +return 0 ; +} +int i915_gem_context_getparam_ioctl (struct drm_device *dev,void *data,struct drm_file *file) {
@@ -853,15 +915,17 @@ int i915_gem_context_getparam_ioctl(struct drm_device *dev, void *data,if (!ctx)return -ENOENT ; - args->size =0 ;switch (args->param) {case I915_CONTEXT_PARAM_BAN_PERIOD : ret = -EINVAL ;break ;case I915_CONTEXT_PARAM_NO_ZEROMAP : + args->size =0 ; args->value =test_bit (UCONTEXT_NO_ZEROMAP , &ctx->user_flags);break ;case I915_CONTEXT_PARAM_GTT_SIZE : + args->size =0 ; +if (ctx->ppgtt) args->value = ctx->ppgtt->vm.total;else if (to_i915 (dev)->mm.aliasing_ppgtt)
@@ -870,14 +934,20 @@ int i915_gem_context_getparam_ioctl(struct drm_device *dev, void *data, args->value =to_i915 (dev)->ggtt.vm.total;break ;case I915_CONTEXT_PARAM_NO_ERROR_CAPTURE : + args->size =0 ; args->value =i915_gem_context_no_error_capture (ctx);break ;case I915_CONTEXT_PARAM_BANNABLE : + args->size =0 ; args->value =i915_gem_context_is_bannable (ctx);break ;case I915_CONTEXT_PARAM_PRIORITY : + args->size =0 ; args->value = ctx->sched.priority >>I915_USER_PRIORITY_SHIFT ;break ; +case I915_CONTEXT_PARAM_SSEU : + ret =get_sseu (ctx, args); +break ;default : ret = -EINVAL ;break ;
@@ -887,6 +957,271 @@ int i915_gem_context_getparam_ioctl(struct drm_device *dev, void *data,return ret; } +static int gen8_emit_rpcs_config (struct i915_request *rq, +struct intel_context *ce, +struct intel_sseu sseu) +{ +u64 offset; +u32 *cs; + + cs =intel_ring_begin (rq,4 ); +if (IS_ERR (cs)) +return PTR_ERR (cs); + + offset = ce->state->node.start + +LRC_STATE_PN *PAGE_SIZE + + (CTX_R_PWR_CLK_STATE +1 ) *4 ; + + *cs++ =MI_STORE_DWORD_IMM_GEN4 |MI_USE_GGTT ; + *cs++ =lower_32_bits (offset); + *cs++ =upper_32_bits (offset); + *cs++ =gen8_make_rpcs (rq->i915, &sseu); + +intel_ring_advance (rq, cs); + +return 0 ; +} + +static int +gen8_modify_rpcs_gpu (struct intel_context *ce, +struct intel_engine_cs *engine, +struct intel_sseu sseu) +{ +struct drm_i915_private *i915 = engine->i915; +struct i915_request *rq, *prev; +int ret; + +GEM_BUG_ON (!ce->pin_count); + +lockdep_assert_held (&i915->drm.struct_mutex); + +/* Submitting requests etc needs the hw awake. */ +intel_runtime_pm_get (i915); + + rq =i915_request_alloc (engine, i915->kernel_context); +if (IS_ERR (rq)) { + ret =PTR_ERR (rq); + goto out_put; + } + +/* Queue this switch after all other activity by this context. */ + prev =i915_gem_active_raw (&ce->ring->timeline->last_request, + &i915->drm.struct_mutex); +if (prev && !i915_request_completed (prev)) { + ret =i915_sw_fence_await_sw_fence_gfp (&rq->submit, + &prev->submit, +I915_FENCE_GFP ); +if (ret <0 ) + goto out_add; + } + + ret =gen8_emit_rpcs_config (rq, ce, sseu); +if (ret) + goto out_add; + +/* Order all following requests to be after. */ +i915_timeline_set_barrier (ce->ring->timeline, rq); + +/* +* Guarantee context image and the timeline remains pinned until the +* modifying request is retired by setting the ce activity tracker. +* +* But we only need to take one pin on the account of it. Or in other +* words transfer the pinned ce object to tracked active request. +*/ +if (!i915_gem_active_isset (&ce->active_tracker)) +__intel_context_pin (ce); +i915_gem_active_set (&ce->active_tracker, rq); + +out_add: +i915_request_add (rq); +out_put: +intel_runtime_pm_put (i915); + +return ret; +} + +static int +i915_gem_context_reconfigure_sseu (struct i915_gem_context *ctx, +struct intel_engine_cs *engine, +struct intel_sseu sseu) +{ +struct intel_context *ce =to_intel_context (ctx, engine); +int ret; + +GEM_BUG_ON (INTEL_GEN (ctx->i915) <8 ); +GEM_BUG_ON (engine->id !=RCS ); + + ret =mutex_lock_interruptible (&ctx->i915->drm.struct_mutex); +if (ret) +return ret; + +/* Nothing to do if unmodified. */ +if (!memcmp (&ce->sseu, &sseu,sizeof (sseu))) + goto out; + +/* +* If context is not idle we have to submit an ordered request to modify +* its context image via the kernel context. Pristine and idle contexts +* will be configured on pinning. +*/ +if (ce->pin_count) + ret =gen8_modify_rpcs_gpu (ce, engine, sseu); + +if (!ret) + ce->sseu = sseu; + +out: +mutex_unlock (&ctx->i915->drm.struct_mutex); + +return ret; +} + +static int +user_to_context_sseu (struct drm_i915_private *i915, +const struct drm_i915_gem_context_param_sseu *user, +struct intel_sseu *context) +{ +const struct sseu_dev_info *device = &RUNTIME_INFO (i915)->sseu; + +/* No zeros in any field. */ +if (!user->slice_mask || !user->subslice_mask || + !user->min_eus_per_subslice || !user->max_eus_per_subslice) +return -EINVAL ; + +/* Max > min. */ +if (user->max_eus_per_subslice < user->min_eus_per_subslice) +return -EINVAL ; + +/* Check validity against hardware. */ +if (user->slice_mask & ~device->slice_mask) +return -EINVAL ; + +if (user->subslice_mask & ~device->subslice_mask[0 ]) +return -EINVAL ; + +if (user->max_eus_per_subslice > device->max_eus_per_subslice) +return -EINVAL ; + +/* +* Some future proofing on the types since the uAPI is wider than the +* current internal implementation. +*/ +if (WARN_ON ((fls (user->slice_mask) > +sizeof (context->slice_mask) *BITS_PER_BYTE ) || + (fls (user->subslice_mask) > +sizeof (context->subslice_mask) *BITS_PER_BYTE ) || +overflows_type (user->min_eus_per_subslice, + context->min_eus_per_subslice) || +overflows_type (user->max_eus_per_subslice, + context->max_eus_per_subslice))) +return -EINVAL ; + + context->slice_mask = user->slice_mask; + context->subslice_mask = user->subslice_mask; + context->min_eus_per_subslice = user->min_eus_per_subslice; + context->max_eus_per_subslice = user->max_eus_per_subslice; + +/* Part specific restrictions. */ +if (IS_GEN (i915,11 )) { +unsigned int hw_s =hweight8 (device->slice_mask); +unsigned int hw_ss_per_s =hweight8 (device->subslice_mask[0 ]); +unsigned int req_s =hweight8 (context->slice_mask); +unsigned int req_ss =hweight8 (context->subslice_mask); + +/* +* Only full subslice enablement is possible if more than one +* slice is turned on. +*/ +if (req_s >1 && req_ss != hw_ss_per_s) +return -EINVAL ; + +/* +* If more than four (SScount bitfield limit) subslices are +* requested then the number has to be even. +*/ +if (req_ss >4 && (req_ss &1 )) +return -EINVAL ; + +/* +* If only one slice is enabled and subslice count is below the +* device full enablement, it must be at most half of the all +* available subslices. +*/ +if (req_s ==1 && req_ss < hw_ss_per_s && + req_ss > (hw_ss_per_s /2 )) +return -EINVAL ; + +/* ABI restriction - VME use case only. */ + +/* All slices or one slice only. */ +if (req_s !=1 && req_s != hw_s) +return -EINVAL ; + +/* +* Half subslices or full enablement only when one slice is +* enabled. +*/ +if (req_s ==1 && + (req_ss != hw_ss_per_s && req_ss != (hw_ss_per_s /2 ))) +return -EINVAL ; + +/* No EU configuration changes. */ +if ((user->min_eus_per_subslice != + device->max_eus_per_subslice) || + (user->max_eus_per_subslice != + device->max_eus_per_subslice)) +return -EINVAL ; + } + +return 0 ; +} + +static int set_sseu (struct i915_gem_context *ctx, +struct drm_i915_gem_context_param *args) +{ +struct drm_i915_private *i915 = ctx->i915; +struct drm_i915_gem_context_param_sseu user_sseu; +struct intel_engine_cs *engine; +struct intel_sseu sseu; +int ret; + +if (args->size <sizeof (user_sseu)) +return -EINVAL ; + +if (!IS_GEN (i915,11 )) +return -ENODEV ; + +if (copy_from_user (&user_sseu,u64_to_user_ptr (args->value), +sizeof (user_sseu))) +return -EFAULT ; + +if (user_sseu.flags || user_sseu.rsvd) +return -EINVAL ; + + engine =intel_engine_lookup_user (i915, + user_sseu.engine_class, + user_sseu.engine_instance); +if (!engine) +return -EINVAL ; + +/* Only render engine supports RPCS configuration. */ +if (engine->class !=RENDER_CLASS ) +return -ENODEV ; + + ret =user_to_context_sseu (i915, &user_sseu, &sseu); +if (ret) +return ret; + + ret =i915_gem_context_reconfigure_sseu (ctx, engine, sseu); +if (ret) +return ret; + + args->size =sizeof (user_sseu); + +return 0 ; +} +int i915_gem_context_setparam_ioctl (struct drm_device *dev,void *data,struct drm_file *file) {
@@ -949,7 +1284,9 @@ int i915_gem_context_setparam_ioctl(struct drm_device *dev, void *data,I915_USER_PRIORITY (priority); }break ; - +case I915_CONTEXT_PARAM_SSEU : + ret =set_sseu (ctx, args); +break ;default : ret = -EINVAL ;break ;
drivers/gpu/drm/i915/i915_gem_context.h +6 -0
@@ -171,6 +171,12 @@ struct i915_gem_context {u64 lrc_desc;int pin_count; +/** +* active_tracker: Active tracker for the external rq activity +* on this intel_context object. +*/ +struct i915_gem_active active_tracker; +const struct intel_context_ops *ops;/** sseu: Control eu/slice partitioning */
drivers/gpu/drm/i915/intel_lrc.c +3 -1
@@ -2388,7 +2388,9 @@ u32 gen8_make_rpcs(struct drm_i915_private *i915, struct intel_sseu *req_sseu)* subslices are enabled, or a count between one and four on the first * slice. */ -if (IS_GEN (i915,11 ) && slices ==1 && subslices >=4 ) { +if (IS_GEN (i915,11 ) && + slices ==1 && + subslices >min_t (u8,4 ,hweight8 (sseu->subslice_mask[0 ]) /2 )) {GEM_BUG_ON (subslices &1 ); subslice_pg = false;
include/uapi/drm/i915_drm.h +64 -0
73 lines not on this page · raw message
Signature · 6 lines
2.17.2 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH 5/6] drm/i915: Expose RPCS (SSEU) configuration to userspace (Gen11 only)
Quoted 150 lines · Joonas Lahtinen
From: Tvrtko Ursulin <[email protected]>
We want to allow userspace to reconfigure the subslice configuration on a per context basis.
This is required for the functional requirement of shutting down non-VME enabled sub-slices on Gen11 parts.
To do so, we expose a context parameter to allow adjustment of the RPCS register stored within the context image (and currently not accessible via LRI).
If the context is adjusted before first use or whilst idle, the adjustment is for "free"; otherwise if the context is active we queue a request to do so (using the kernel context), following all other activity by that context, which is also marked as barrier for all following submission against the same context.
Since the overhead of device re-configuration during context switching can be significant, especially in multi-context workloads, we limit this new uAPI to only support the Gen11 VME use case. In this use case either the device is fully enabled, and exactly one slice and half of the subslices are enabled.
Example usage:
struct drm_i915_gem_context_param_sseu sseu = { }; struct drm_i915_gem_context_param arg = { .param = I915_CONTEXT_PARAM_SSEU, .ctx_id = gem_context_create(fd), .size = sizeof(sseu), .value = to_user_pointer(&sseu) }; /* Query device defaults. */ gem_context_get_param(fd, &arg); /* Set VME configuration on a 1x6x8 part. */ sseu.slice_mask = 0x1; sseu.subslice_mask = 0xe0; gem_context_set_param(fd, &arg);v2: Fix offset of
CTX_R_PWR_CLK_STATEinintel_lr_context_set_sseu()(Lionel)v3: Add ability to program this per engine (Chris)
v4: Move most
get_sseu()intoi915_gem_context.c(Lionel)v5: Validate sseu configuration against the device's capabilities (Lionel)
v6: Change context powergating settings through
MI_SDMon kernel context (Chris)v7: Synchronize the requests following a powergating setting change using a global
dependency (Chris)
Iterate timelines through dev_priv.gt.active_rings (Tvrtko) Disable RPCS configuration setting for non capable users (Lionel/Tvrtko)v8: s/union intel_sseu/struct intel_sseu/ (Lionel)
s/dev_priv/i915/ (Tvrtko)
Change uapi class/instance fields to u16 (Tvrtko) Bump mask fields to 64bits (Lionel)
Don't return EPERM when dynamic sseu is disabled (Tvrtko)v9: Import context image into kernel context's ppgtt only when
reconfiguring powergated slice/subslices (Chris) Use aliasing ppgtt when needed (Michel)Tvrtko Ursulin:
v10:
* Update for upstream changes.
* Request submit needs a RPM reference.
* Reject on !FULL_PPGTT for simplicity.
* Pull out get/set param to helpers for readability and less indent.
* Usei915_request_await_dma_fenceinadd_global_barrierto skip waits on the same timeline and avoidGEM_BUG_ON.
* No need to explicitly assign a NULL pointer to engine in legacy mode.
* No need to movegen8_make_rpcsup.
* Factored out global barrier as prep patch.
* Allow to onlyCAP_SYS_ADMINif !Gen11.v11:
* Remove engine vfunc in favour of local helper. (Chris Wilson)
* Stop retiring requests before updates since it is not needed (Chris Wilson)
* Implement direct CPU update path for idle contexts. (Chris Wilson)
* Left side dependency needs only be on the same context timeline. (Chris Wilson)
* It is sufficient to order the timeline. (Chris Wilson)
* Reject !RCS configuration attempts with-ENODEVfor now.v12:
* Rebase formake_rpcs.v13:
* Centralize SSEU normalization tomake_rpcs.
* Type width checking (uAPI <-> implementation).
* Gen11 restrictions uAPI checks.
* Gen11 subslice count differences handling.
Chris Wilson:
*args->sizehandling fixes.
* Update context image from GGTT.
* Postpone context image update to pinning.
* Usei915_gem_active_rawinstead oflast_request_on_engine.v14:
* Add activity tracker onintel_contextto fix the lifetime issues and simplify the code. (Chris Wilson)v15:
* Fix context pin leak if no space in ring by simplifying the context pinning sequence.v16:
* Rebase for context get/set param locking changes.
* Just-ENODEVon !Gen11. (Joonas)v17:
* Fix one Gen11 subslice enablement rule.
* Handle error fromi915_sw_fence_await_sw_fence_gfp. (Chris Wilson)v18:
* Update commit message. (Joonas)
* Restrict uAPI to VME use case. (Joonas)v19:
* Rebase.v20:
* Rebase force->active_tracker.v21:
* Rebase forIS_GENchanges.v22:
* Reserve uAPI for flags straight away. (Chris Wilson)v23:
* Rebase forRUNTIME_INFO.v24:
* Added some headline docs for the uapi usage. (Joonas/Chris)v25:
* Renamed class/instance to engine_class/engine_instance to avoid clash with C++ keyword. (Tony Ye)Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=100899
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=107634
Issue: https://github.com/intel/media-driver/issues/267
Quoted 10 lines
Signed-off-by Chris Wilson <[email protected]>Signed-off-by Lionel Landwerlin <[email protected]>Cc Dmitry Rogozhkin <[email protected]>Cc Tvrtko Ursulin <[email protected]>Cc Zhipeng Gong <[email protected]>Cc Joonas Lahtinen <[email protected]>Cc Tony Ye <[email protected]>Signed-off-by Tvrtko Ursulin <[email protected]>Reviewed-by Chris Wilson <[email protected]> # v21Reviewed-by Joonas Lahtinen <[email protected]>
Hi, we're targeting the new media driver to be included in the next Ubuntu release (19.04), so
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH 5/6] drm/i915: Expose RPCS (SSEU) configuration to userspace (Gen11 only)
In reply to Joonas LahtinenQuoted 151 lines · Joonas Lahtinen
From: Tvrtko Ursulin <[email protected]>
We want to allow userspace to reconfigure the subslice configuration on a per context basis.
This is required for the functional requirement of shutting down non-VME enabled sub-slices on Gen11 parts.
To do so, we expose a context parameter to allow adjustment of the RPCS register stored within the context image (and currently not accessible via LRI).
If the context is adjusted before first use or whilst idle, the adjustment is for "free"; otherwise if the context is active we queue a request to do so (using the kernel context), following all other activity by that context, which is also marked as barrier for all following submission against the same context.
Since the overhead of device re-configuration during context switching can be significant, especially in multi-context workloads, we limit this new uAPI to only support the Gen11 VME use case. In this use case either the device is fully enabled, and exactly one slice and half of the subslices are enabled.
Example usage:
struct drm_i915_gem_context_param_sseu sseu = { }; struct drm_i915_gem_context_param arg = { .param = I915_CONTEXT_PARAM_SSEU, .ctx_id = gem_context_create(fd), .size = sizeof(sseu), .value = to_user_pointer(&sseu) }; /* Query device defaults. */ gem_context_get_param(fd, &arg); /* Set VME configuration on a 1x6x8 part. */ sseu.slice_mask = 0x1; sseu.subslice_mask = 0xe0; gem_context_set_param(fd, &arg);v2: Fix offset of
CTX_R_PWR_CLK_STATEinintel_lr_context_set_sseu()(Lionel)v3: Add ability to program this per engine (Chris)
v4: Move most
get_sseu()intoi915_gem_context.c(Lionel)v5: Validate sseu configuration against the device's capabilities (Lionel)
v6: Change context powergating settings through
MI_SDMon kernel context (Chris)v7: Synchronize the requests following a powergating setting change using a global
dependency (Chris)
Iterate timelines through dev_priv.gt.active_rings (Tvrtko) Disable RPCS configuration setting for non capable users (Lionel/Tvrtko)v8: s/union intel_sseu/struct intel_sseu/ (Lionel)
s/dev_priv/i915/ (Tvrtko)
Change uapi class/instance fields to u16 (Tvrtko) Bump mask fields to 64bits (Lionel)
Don't return EPERM when dynamic sseu is disabled (Tvrtko)v9: Import context image into kernel context's ppgtt only when
reconfiguring powergated slice/subslices (Chris) Use aliasing ppgtt when needed (Michel)Tvrtko Ursulin:
v10:
* Update for upstream changes.
* Request submit needs a RPM reference.
* Reject on !FULL_PPGTT for simplicity.
* Pull out get/set param to helpers for readability and less indent.
* Usei915_request_await_dma_fenceinadd_global_barrierto skip waits on the same timeline and avoidGEM_BUG_ON.
* No need to explicitly assign a NULL pointer to engine in legacy mode.
* No need to movegen8_make_rpcsup.
* Factored out global barrier as prep patch.
* Allow to onlyCAP_SYS_ADMINif !Gen11.v11:
* Remove engine vfunc in favour of local helper. (Chris Wilson)
* Stop retiring requests before updates since it is not needed (Chris Wilson)
* Implement direct CPU update path for idle contexts. (Chris Wilson)
* Left side dependency needs only be on the same context timeline. (Chris Wilson)
* It is sufficient to order the timeline. (Chris Wilson)
* Reject !RCS configuration attempts with-ENODEVfor now.v12:
* Rebase formake_rpcs.v13:
* Centralize SSEU normalization tomake_rpcs.
* Type width checking (uAPI <-> implementation).
* Gen11 restrictions uAPI checks.
* Gen11 subslice count differences handling.
Chris Wilson:
*args->sizehandling fixes.
* Update context image from GGTT.
* Postpone context image update to pinning.
* Usei915_gem_active_rawinstead oflast_request_on_engine.v14:
* Add activity tracker onintel_contextto fix the lifetime issues and simplify the code. (Chris Wilson)v15:
* Fix context pin leak if no space in ring by simplifying the context pinning sequence.v16:
* Rebase for context get/set param locking changes.
* Just-ENODEVon !Gen11. (Joonas)v17:
* Fix one Gen11 subslice enablement rule.
* Handle error fromi915_sw_fence_await_sw_fence_gfp. (Chris Wilson)v18:
* Update commit message. (Joonas)
* Restrict uAPI to VME use case. (Joonas)v19:
* Rebase.v20:
* Rebase force->active_tracker.v21:
* Rebase forIS_GENchanges.v22:
* Reserve uAPI for flags straight away. (Chris Wilson)v23:
* Rebase forRUNTIME_INFO.v24:
* Added some headline docs for the uapi usage. (Joonas/Chris)v25:
* Renamed class/instance to engine_class/engine_instance to avoid clash with C++ keyword. (Tony Ye)Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=100899
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=107634
Issue: https://github.com/intel/media-driver/issues/267
Quoted 10 lines
Signed-off-by Chris Wilson <[email protected]>Signed-off-by Lionel Landwerlin <[email protected]>Cc Dmitry Rogozhkin <[email protected]>Cc Tvrtko Ursulin <[email protected]>Cc Zhipeng Gong <[email protected]>Cc Joonas Lahtinen <[email protected]>Cc Tony Ye <[email protected]>Signed-off-by Tvrtko Ursulin <[email protected]>Reviewed-by Chris Wilson <[email protected]> # v21Reviewed-by Joonas Lahtinen <[email protected]>
The change looks good to me.
Feel free to take my ack
thanks,
Takashi
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Joonas Lahtinen
maintainerPATCH 6/6 drm/i915/selftests: Context SSEU reconfiguration tests
In reply to Joonas LahtinenFrom: Tvrtko Ursulin <[email protected]>
Exercise the context image reconfiguration logic for idle and busy contexts, with the resets thrown into the mix as well.
Free from the uAPI restrictions this test runs on all Gen9+ platforms with slice power gating.
v2:
* Rename some helpers for clarity.
* Include subtest names in error logs.
* Remove unnecessary function export.
v3:
* Rebase for RUNTIME_INFO.
v4:
* Fix incomplete unexport from v2. (Chris Wilson)
--- drivers/gpu/drm/i915/i915_gem_context.c | 31 +- .../gpu/drm/i915/selftests/i915_gem_context.c | 481 ++++++++++++++++++ 2 files changed, 502 insertions(+), 10 deletions(-)
drivers/gpu/drm/i915/i915_gem_context.c +21 -10
@@ -1042,23 +1042,19 @@ gen8_modify_rpcs_gpu(struct intel_context *ce, }static int -i915_gem_context_reconfigure_sseu (struct i915_gem_context *ctx, -struct intel_engine_cs *engine, -struct intel_sseu sseu) +__i915_gem_context_reconfigure_sseu (struct i915_gem_context *ctx, +struct intel_engine_cs *engine, +struct intel_sseu sseu) {struct intel_context *ce =to_intel_context (ctx, engine); -int ret; +int ret =0 ;GEM_BUG_ON (INTEL_GEN (ctx->i915) <8 );GEM_BUG_ON (engine->id !=RCS ); - ret =mutex_lock_interruptible (&ctx->i915->drm.struct_mutex); -if (ret) -return ret; -/* Nothing to do if unmodified. */ if (!memcmp (&ce->sseu, &sseu,sizeof (sseu))) - goto out; +return 0 ;/* * If context is not idle we have to submit an ordered request to modify
@@ -1071,7 +1067,22 @@ i915_gem_context_reconfigure_sseu(struct i915_gem_context *ctx,if (!ret) ce->sseu = sseu; -out: +return ret; +} + +static int +i915_gem_context_reconfigure_sseu (struct i915_gem_context *ctx, +struct intel_engine_cs *engine, +struct intel_sseu sseu) +{ +int ret; + + ret =mutex_lock_interruptible (&ctx->i915->drm.struct_mutex); +if (ret) +return ret; + + ret =__i915_gem_context_reconfigure_sseu (ctx, engine, sseu); +mutex_unlock (&ctx->i915->drm.struct_mutex);return ret;
drivers/gpu/drm/i915/selftests/i915_gem_context.c +481 -0
499 lines not on this page · raw message
Signature · 6 lines
2.17.2 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI✗ Fi.CI.BAT: failure for Add uAPI to support ICL VME hardware for new media-driver
In reply to Joonas Lahtinen== Series Details ==
== Series Details ==
Series: Add uAPI to support ICL VME hardware for new media-driver
URL : https://patchwork.freedesktop.org/series/55249/
State : failure
== Summary ==
CALL scripts/checksyscalls.sh
DESCEND objtool
CHK include/generated/compile.h
CC [M] drivers/gpu/drm/i915/i915_gem_context.odrivers/gpu/drm/i915/i915_gem_context.c: In function ‘gen8_modify_rpcs_gpu’:drivers/gpu/drm/i915/i915_gem_context.c:1039:2: error: too few arguments to function ‘intel_runtime_pm_put’
intel_runtime_pm_put(i915);
^~~~~~~~~~~~~~~~~~~~
In file included from drivers/gpu/drm/i915/i915_trace.h:10:0,
from drivers/gpu/drm/i915/i915_drv.h:2577,
from drivers/gpu/drm/i915/i915_gem_context.c:90:
drivers/gpu/drm/i915/intel_drv.h:2208:6: note: declared here
void intel_runtime_pm_put(struct drm_i915_private *i915, intel_wakeref_t wref);
^~~~~~~~~~~~~~~~~~~~In file included from drivers/gpu/drm/i915/i915_gem_context.c:1377:0:drivers/gpu/drm/i915/selftests/i915_gem_context.c: In function ‘__igt_ctx_sseu’:drivers/gpu/drm/i915/selftests/i915_gem_context.c:1097:2: error: too few arguments to function ‘intel_runtime_pm_put’
intel_runtime_pm_put(i915);
^~~~~~~~~~~~~~~~~~~~
In file included from drivers/gpu/drm/i915/i915_trace.h:10:0,
from drivers/gpu/drm/i915/i915_drv.h:2577,
from drivers/gpu/drm/i915/i915_gem_context.c:90:
drivers/gpu/drm/i915/intel_drv.h:2208:6: note: declared here
void intel_runtime_pm_put(struct drm_i915_private *i915, intel_wakeref_t wref);
^~~~~~~~~~~~~~~~~~~~scripts/Makefile.build:276: recipe for target 'drivers/gpu/drm/i915/i915_gem_context.o' failed make[4]: *** [drivers/gpu/drm/i915/i915_gem_context.o] Error 1 scripts/Makefile.build:492: recipe for target 'drivers/gpu/drm/i915' failed make[3]: *** [drivers/gpu/drm/i915] Error 2scripts/Makefile.build:492: recipe for target 'drivers/gpu/drm' failed
make[2]: *** [drivers/gpu/drm] Error 2scripts/Makefile.build:492: recipe for target 'drivers/gpu' failed
make[1]: *** [drivers/gpu] Error 2
Makefile:1042: recipe for target 'drivers' failed
make: *** [drivers] Error 2
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Joonas Lahtinen
maintainerQuoting Joonas Lahtinen (2019-01-15 16:47:27)
Quoted 8 lines
Hi all,
I would like to have some Acked-by's from you, the distro media folks Cc'd here, to document your intent to start using Intel's new media driver[1]. So if you recognize yourself (or are otherwise interested), please read on.
TL;DR Distro folks, please give your Acked-by on patch [5/6]
A gentle reminder, I'm still looking to hear back from Stephane and Dave.
We'd like to have this included in the final 5.1 drm-intel-next pull request this week.
If there are no further comments by Wed, I will conclude that we have reached a silent agreement, and merge this to give enough time for Rodrigo to send the PR.
Regards, Joonas
Quoted 74 lines
I believe most are already aware of the situation that Intel is moving to the new codebase for libva backend to support new Intel integrated graphics devices. The existing intel-libva-driver will be continue to be be supported for pre-Icelake platforms (<Gen11). Icelake and further platforms will only be supported from the new codebase.
There's the complication that some Icelake features of the new driver will require new kernel uAPIs to work... But the new driver has not yet been well-established in the community from perspective of fulfilling [2]. This is very much due to the demand being low as Icelake is not widely available yet. So it's bit of a chicken and egg problem as we have a new platform *and* a new codebase for it simultaneously.
Ahead of that community adoption, to ensure that Icelake has good kernel support from day one, we'd like to merge kernel support for the parts that have functional effect (this series). This is to avoid the scenario where end users have to update their distro kernels, like happened with Skylake.
So if I could get Acked-by's from distro folks on the patch [5/6] that adds the new uAPI. That would document their intent to become an active user of the media-driver[1]. If that happens in the next week or two, it would mean that Icelake hardware features would be supported in kernel version 5.1 fully from kernel driver point of view.
The new uAPI is needed to make VME feature functionally work on Icelake. It's pretty much a simple enable/disable switch for hardware configuration that only includes hardware slices compatible with the VME workload. So it's currently limited to the required on/off choice to keep things straightforward. The uAPI can be extended in the future for possible performance gains for more fine-grained control.
VME is shared function to handle motion estimation. One intended usercase is in Hierarchical Motion Estimation (HME) media kernel. It provides a bigger search range with reduced cost for the search. HME should improve the encode quality with scenarios where the video has a lot of motion in it. Carl (Cc'd) can provide more details if needed.
The respective IGT tests are reviewed and can be found at:
https://patchwork.freedesktop.org/series/49190/
The userspace changes are reviewed and rebased here:
https://github.com/intel/media-driver/pull/271
https://github.com/intel/media-driver/pull/463Best Regards, Joonas Lahtinen
Cc Timo Aaltonen <[email protected]>Cc Takashi Iwai <[email protected]>Cc Stephane Marchesin <[email protected]>Cc Dave Airlie <[email protected]>Cc Daniel Vetter <[email protected]>PS. This series might result in some CI failures reported as it adds new uAPI
and Patchwork / CI synchronization of tests and kernel is currently WIP.[1] https://github.com/intel/media-driver
[2] https://01.org/linuxgraphics/gfx-docs/drm/gpu/drm-uapi.html#open-source-userspace-requirementsLionel Landwerlin (2):
drm/i915: Record the sseu configuration per-context & engine drm/i915/perf: lock powergating configuration to default when activeTvrtko Ursulin (4):
drm/i915/execlists: Move RPCS setup to context pin drm/i915: Add timeline barrier support
drm/i915: Expose RPCS (SSEU) configuration to userspace (Gen11 only) drm/i915/selftests: Context SSEU reconfiguration tests
Quoted 18 lines
drivers/gpu/drm/i915/i915_drv.h | 14 + drivers/gpu/drm/i915/i915_gem_context.c | 354 ++++++++++++- drivers/gpu/drm/i915/i915_gem_context.h | 10 + drivers/gpu/drm/i915/i915_perf.c | 13 +- drivers/gpu/drm/i915/i915_request.c | 13 + drivers/gpu/drm/i915/i915_request.h | 10 + drivers/gpu/drm/i915/i915_timeline.c | 3 + drivers/gpu/drm/i915/i915_timeline.h | 27 + drivers/gpu/drm/i915/intel_lrc.c | 100 ++-- drivers/gpu/drm/i915/intel_lrc.h | 2 + .../gpu/drm/i915/selftests/i915_gem_context.c | 481 ++++++++++++++++++ .../gpu/drm/i915/selftests/mock_timeline.c | 2 + include/uapi/drm/i915_drm.h | 64 +++ 13 files changed, 1056 insertions(+), 37 deletions(-)Signature · 1 line
2.17.2
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Quoted 13 lines · Joonas Lahtinen
Quoting Joonas Lahtinen (2019-01-15 16:47:27)
Quoted 8 lines
Hi all,
I would like to have some Acked-by's from you, the distro media folks Cc'd here, to document your intent to start using Intel's new media driver[1]. So if you recognize yourself (or are otherwise interested), please read on.
TL;DR Distro folks, please give your Acked-by on patch [5/6]
A gentle reminder, I'm still looking to hear back from Stephane and Dave.
Quoted 6 lines
We'd like to have this included in the final 5.1 drm-intel-next pull request this week.
If there are no further comments by Wed, I will conclude that we have reached a silent agreement, and merge this to give enough time for Rodrigo to send the PR.
Maybe should add that ubunut/suse folks seem ok. Also, it's for libva, in the past that's been very far down the list of contentious topics. Mostly positive meh seems plenty good enough feedback I think. -Daniel
Quoted 95 lines
Regards, Joonas
Quoted 92 lines
I believe most are already aware of the situation that Intel is moving to the new codebase for libva backend to support new Intel integrated graphics devices. The existing intel-libva-driver will be continue to be be supported for pre-Icelake platforms (<Gen11). Icelake and further platforms will only be supported from the new codebase.
There's the complication that some Icelake features of the new driver will require new kernel uAPIs to work... But the new driver has not yet been well-established in the community from perspective of fulfilling [2]. This is very much due to the demand being low as Icelake is not widely available yet. So it's bit of a chicken and egg problem as we have a new platform *and* a new codebase for it simultaneously.
Ahead of that community adoption, to ensure that Icelake has good kernel support from day one, we'd like to merge kernel support for the parts that have functional effect (this series). This is to avoid the scenario where end users have to update their distro kernels, like happened with Skylake.
So if I could get Acked-by's from distro folks on the patch [5/6] that adds the new uAPI. That would document their intent to become an active user of the media-driver[1]. If that happens in the next week or two, it would mean that Icelake hardware features would be supported in kernel version 5.1 fully from kernel driver point of view.
The new uAPI is needed to make VME feature functionally work on Icelake. It's pretty much a simple enable/disable switch for hardware configuration that only includes hardware slices compatible with the VME workload. So it's currently limited to the required on/off choice to keep things straightforward. The uAPI can be extended in the future for possible performance gains for more fine-grained control.
VME is shared function to handle motion estimation. One intended usercase is in Hierarchical Motion Estimation (HME) media kernel. It provides a bigger search range with reduced cost for the search. HME should improve the encode quality with scenarios where the video has a lot of motion in it. Carl (Cc'd) can provide more details if needed.
The respective IGT tests are reviewed and can be found at:
https://patchwork.freedesktop.org/series/49190/
The userspace changes are reviewed and rebased here:
https://github.com/intel/media-driver/pull/271
https://github.com/intel/media-driver/pull/463Best Regards, Joonas Lahtinen
Cc Timo Aaltonen <[email protected]>Cc Takashi Iwai <[email protected]>Cc Stephane Marchesin <[email protected]>Cc Dave Airlie <[email protected]>Cc Daniel Vetter <[email protected]>PS. This series might result in some CI failures reported as it adds new uAPI
and Patchwork / CI synchronization of tests and kernel is currently WIP.[1] https://github.com/intel/media-driver
[2] https://01.org/linuxgraphics/gfx-docs/drm/gpu/drm-uapi.html#open-source-userspace-requirementsLionel Landwerlin (2):
drm/i915: Record the sseu configuration per-context & engine drm/i915/perf: lock powergating configuration to default when activeTvrtko Ursulin (4):
drm/i915/execlists: Move RPCS setup to context pin drm/i915: Add timeline barrier support
drm/i915: Expose RPCS (SSEU) configuration to userspace (Gen11 only) drm/i915/selftests: Context SSEU reconfiguration testsdrivers/gpu/drm/i915/i915_drv.h | 14 + drivers/gpu/drm/i915/i915_gem_context.c | 354 ++++++++++++- drivers/gpu/drm/i915/i915_gem_context.h | 10 + drivers/gpu/drm/i915/i915_perf.c | 13 +- drivers/gpu/drm/i915/i915_request.c | 13 + drivers/gpu/drm/i915/i915_request.h | 10 + drivers/gpu/drm/i915/i915_timeline.c | 3 + drivers/gpu/drm/i915/i915_timeline.h | 27 + drivers/gpu/drm/i915/intel_lrc.c | 100 ++-- drivers/gpu/drm/i915/intel_lrc.h | 2 + .../gpu/drm/i915/selftests/i915_gem_context.c | 481 ++++++++++++++++++ .../gpu/drm/i915/selftests/mock_timeline.c | 2 + include/uapi/drm/i915_drm.h | 64 +++ 13 files changed, 1056 insertions(+), 37 deletions(-)Signature · 1 line
2.17.2
Signature · 7 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Stéphane Marchesin
Acked-byQuoted 18 lines · Daniel Vetter
Quoted 16 lines · Joonas Lahtinen
Quoting Joonas Lahtinen (2019-01-15 16:47:27)
Quoted 8 lines
Hi all,
I would like to have some Acked-by's from you, the distro media folks Cc'd here, to document your intent to start using Intel's new media driver[1]. So if you recognize yourself (or are otherwise interested), please read on.
TL;DR Distro folks, please give your Acked-by on patch [5/6]
A gentle reminder, I'm still looking to hear back from Stephane and Dave.
We'd like to have this included in the final 5.1 drm-intel-next pull request this week.
Quoted 7 lines
Quoted 3 lines
If there are no further comments by Wed, I will conclude that we have reached a silent agreement, and merge this to give enough time for Rodrigo to send the PR.
Maybe should add that ubunut/suse folks seem ok. Also, it's for libva, in the past that's been very far down the list of contentious topics. Mostly positive meh seems plenty good enough feedback I think.
FWIW I think the API changes are fine. Sure it feels a bit odd at first, but there's no better alternative that I can see either.
Quoted 94 lines
-Daniel
Quoted 92 lines
Regards, Joonas
Quoted 89 lines
I believe most are already aware of the situation that Intel is moving to the new codebase for libva backend to support new Intel integrated graphics devices. The existing intel-libva-driver will be continue to be be supported for pre-Icelake platforms (<Gen11). Icelake and further platforms will only be supported from the new codebase.
There's the complication that some Icelake features of the new driver will require new kernel uAPIs to work... But the new driver has not yet been well-established in the community from perspective of fulfilling [2]. This is very much due to the demand being low as Icelake is not widely available yet. So it's bit of a chicken and egg problem as we have a new platform *and* a new codebase for it simultaneously.
Ahead of that community adoption, to ensure that Icelake has good kernel support from day one, we'd like to merge kernel support for the parts that have functional effect (this series). This is to avoid the scenario where end users have to update their distro kernels, like happened with Skylake.
So if I could get Acked-by's from distro folks on the patch [5/6] that adds the new uAPI. That would document their intent to become an active user of the media-driver[1]. If that happens in the next week or two, it would mean that Icelake hardware features would be supported in kernel version 5.1 fully from kernel driver point of view.
The new uAPI is needed to make VME feature functionally work on Icelake. It's pretty much a simple enable/disable switch for hardware configuration that only includes hardware slices compatible with the VME workload. So it's currently limited to the required on/off choice to keep things straightforward. The uAPI can be extended in the future for possible performance gains for more fine-grained control.
VME is shared function to handle motion estimation. One intended usercase is in Hierarchical Motion Estimation (HME) media kernel. It provides a bigger search range with reduced cost for the search. HME should improve the encode quality with scenarios where the video has a lot of motion in it. Carl (Cc'd) can provide more details if needed.
The respective IGT tests are reviewed and can be found at:
https://patchwork.freedesktop.org/series/49190/
The userspace changes are reviewed and rebased here:
https://github.com/intel/media-driver/pull/271
https://github.com/intel/media-driver/pull/463Best Regards, Joonas Lahtinen
Cc Timo Aaltonen <[email protected]>Cc Takashi Iwai <[email protected]>Cc Stephane Marchesin <[email protected]>Cc Dave Airlie <[email protected]>Cc Daniel Vetter <[email protected]>PS. This series might result in some CI failures reported as it adds new uAPI
and Patchwork / CI synchronization of tests and kernel is currently WIP.[1] https://github.com/intel/media-driver
[2] https://01.org/linuxgraphics/gfx-docs/drm/gpu/drm-uapi.html#open-source-userspace-requirementsLionel Landwerlin (2):
drm/i915: Record the sseu configuration per-context & engine drm/i915/perf: lock powergating configuration to default when activeTvrtko Ursulin (4):
drm/i915/execlists: Move RPCS setup to context pin drm/i915: Add timeline barrier support
drm/i915: Expose RPCS (SSEU) configuration to userspace (Gen11 only) drm/i915/selftests: Context SSEU reconfiguration testsdrivers/gpu/drm/i915/i915_drv.h | 14 + drivers/gpu/drm/i915/i915_gem_context.c | 354 ++++++++++++- drivers/gpu/drm/i915/i915_gem_context.h | 10 + drivers/gpu/drm/i915/i915_perf.c | 13 +- drivers/gpu/drm/i915/i915_request.c | 13 + drivers/gpu/drm/i915/i915_request.h | 10 + drivers/gpu/drm/i915/i915_timeline.c | 3 + drivers/gpu/drm/i915/i915_timeline.h | 27 + drivers/gpu/drm/i915/intel_lrc.c | 100 ++-- drivers/gpu/drm/i915/intel_lrc.h | 2 + .../gpu/drm/i915/selftests/i915_gem_context.c | 481 ++++++++++++++++++ .../gpu/drm/i915/selftests/mock_timeline.c | 2 + include/uapi/drm/i915_drm.h | 64 +++ 13 files changed, 1056 insertions(+), 37 deletions(-)
Quoted 8 lines
Quoted 3 lines
Quoted 3 lines
--
2.17.2--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Joonas Lahtinen
maintainerQuoting Stéphane Marchesin (2019-02-05 06:16:48)
Quoted 23 lines · Daniel Vetter
Quoted 22 lines · Joonas Lahtinen
Quoted 19 lines
Quoting Joonas Lahtinen (2019-01-15 16:47:27)
Quoted 8 lines
Hi all,
I would like to have some Acked-by's from you, the distro media folks Cc'd here, to document your intent to start using Intel's new media driver[1]. So if you recognize yourself (or are otherwise interested), please read on.
TL;DR Distro folks, please give your Acked-by on patch [5/6]
A gentle reminder, I'm still looking to hear back from Stephane and Dave.
We'd like to have this included in the final 5.1 drm-intel-next pull request this week.
If there are no further comments by Wed, I will conclude that we have reached a silent agreement, and merge this to give enough time for Rodrigo to send the PR.
Quoted 9 lines
Quoted 3 lines
Maybe should add that ubunut/suse folks seem ok. Also, it's for libva, in the past that's been very far down the list of contentious topics. Mostly positive meh seems plenty good enough feedback I think.
FWIW I think the API changes are fine. Sure it feels a bit odd at first, but there's no better alternative that I can see either.
Dave commented on IRC that he's fine with us proceeding to merge with these Acks in place.
Thank you all for looking into the matter, this will now find its way into Kernel version 5.1.
Regards, Joonas
Quoted 95 lines
Quoted 95 lines
-Daniel
Quoted 92 lines
Regards, Joonas
Quoted 89 lines
I believe most are already aware of the situation that Intel is moving to the new codebase for libva backend to support new Intel integrated graphics devices. The existing intel-libva-driver will be continue to be be supported for pre-Icelake platforms (<Gen11). Icelake and further platforms will only be supported from the new codebase.
There's the complication that some Icelake features of the new driver will require new kernel uAPIs to work... But the new driver has not yet been well-established in the community from perspective of fulfilling [2]. This is very much due to the demand being low as Icelake is not widely available yet. So it's bit of a chicken and egg problem as we have a new platform *and* a new codebase for it simultaneously.
Ahead of that community adoption, to ensure that Icelake has good kernel support from day one, we'd like to merge kernel support for the parts that have functional effect (this series). This is to avoid the scenario where end users have to update their distro kernels, like happened with Skylake.
So if I could get Acked-by's from distro folks on the patch [5/6] that adds the new uAPI. That would document their intent to become an active user of the media-driver[1]. If that happens in the next week or two, it would mean that Icelake hardware features would be supported in kernel version 5.1 fully from kernel driver point of view.
The new uAPI is needed to make VME feature functionally work on Icelake. It's pretty much a simple enable/disable switch for hardware configuration that only includes hardware slices compatible with the VME workload. So it's currently limited to the required on/off choice to keep things straightforward. The uAPI can be extended in the future for possible performance gains for more fine-grained control.
VME is shared function to handle motion estimation. One intended usercase is in Hierarchical Motion Estimation (HME) media kernel. It provides a bigger search range with reduced cost for the search. HME should improve the encode quality with scenarios where the video has a lot of motion in it. Carl (Cc'd) can provide more details if needed.
The respective IGT tests are reviewed and can be found at:
https://patchwork.freedesktop.org/series/49190/
The userspace changes are reviewed and rebased here:
https://github.com/intel/media-driver/pull/271
https://github.com/intel/media-driver/pull/463Best Regards, Joonas Lahtinen
Cc Timo Aaltonen <[email protected]>Cc Takashi Iwai <[email protected]>Cc Stephane Marchesin <[email protected]>Cc Dave Airlie <[email protected]>Cc Daniel Vetter <[email protected]>PS. This series might result in some CI failures reported as it adds new uAPI
and Patchwork / CI synchronization of tests and kernel is currently WIP.[1] https://github.com/intel/media-driver
[2] https://01.org/linuxgraphics/gfx-docs/drm/gpu/drm-uapi.html#open-source-userspace-requirementsLionel Landwerlin (2):
drm/i915: Record the sseu configuration per-context & engine drm/i915/perf: lock powergating configuration to default when activeTvrtko Ursulin (4):
drm/i915/execlists: Move RPCS setup to context pin drm/i915: Add timeline barrier support
drm/i915: Expose RPCS (SSEU) configuration to userspace (Gen11 only) drm/i915/selftests: Context SSEU reconfiguration testsdrivers/gpu/drm/i915/i915_drv.h | 14 + drivers/gpu/drm/i915/i915_gem_context.c | 354 ++++++++++++- drivers/gpu/drm/i915/i915_gem_context.h | 10 + drivers/gpu/drm/i915/i915_perf.c | 13 +- drivers/gpu/drm/i915/i915_request.c | 13 + drivers/gpu/drm/i915/i915_request.h | 10 + drivers/gpu/drm/i915/i915_timeline.c | 3 + drivers/gpu/drm/i915/i915_timeline.h | 27 + drivers/gpu/drm/i915/intel_lrc.c | 100 ++-- drivers/gpu/drm/i915/intel_lrc.h | 2 + .../gpu/drm/i915/selftests/i915_gem_context.c | 481 ++++++++++++++++++ .../gpu/drm/i915/selftests/mock_timeline.c | 2 + include/uapi/drm/i915_drm.h | 64 +++ 13 files changed, 1056 insertions(+), 37 deletions(-)
Quoted 8 lines
Quoted 8 lines
Quoted 3 lines
Quoted 3 lines
--
2.17.2--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel