Overview:
---------
This patch series attempts to clean up some of the IOCTL mess we've created
over the last few years. The most egregious bit being context mutability.
In summary, this series:
1. Drops two never-used context params: RINGSIZE and NO_ZEROMAP
2. Drops the entire CONTEXT_CLONE API
3. Implements SINGLE_TIMELINE with a syncobj instead of actually sharing
intel_timeline between engines.
4. Adds a few sanity restrictions to the balancing/bonding API.
5. Implements a proto-…
[View More]ctx mechanism so that the engine set and VM can only
be set early on in the lifetime of a context, before anything ever
executes on it. This effectively makes the VM and engine set
immutable.
This series has been tested with IGT as well as the Iris, ANV, and the
Intel media driver doing an 8K decode (this uses bonding/balancing). I've
also done quite a bit of git archeology to ensure that nothing in here will
break anything that's already shipped at some point in history. It's
possible I've missed something, but I've dug quite a bit.
Details and motivation:
-----------------------
In very broad strokes, there's an effort going on right now within Intel to
try and clean up and simplify i915 anywhere we can. We obviously don't
want to break any shipping userspace but, as can be seen by this series,
there's a lot i915 theoretically supports which userspace doesn't actually
need. Some of this, like the two context params used here, were simply
oversights where we went through the usual API review process and merged
the i915 bits but the userspace bits never landed for some reason.
Not all are so innocent, however. For instance, there's an entire context
cloning API which allows one to create a context with certain parameters
"cloned" from some other context. This entire API has never been used by
any userspace except IGT and there were never patches to any other
userspace to use it. It never should have landed. Also, when we added
support for setting explicit engine sets and sharing VMs across contexts,
people decided to do so via SET_CONTEXT_PARAM. While this allowed them to
re-use existing API, it did so at the cost of making those states mutable
which leads to a plethora of potential race conditions. There were even
IGT tests merged to cover some of theses:
- gem_vm_create@async-destroy and gem_vm_create@destroy-race which test
swapping out the VM on a running context.
- gem_ctx_persistence@replace* which test whether a client can escape a
non-persistent context by submitting a hanging batch and then swapping
out the engine set before the hang is detected.
- api_intel_bb@bb-with-vm which tests the that intel_bb_assign_vm works
properly. This API is never used by any other IGT test.
There is also an entire deferred flush and set state framework in
i915_gem_cotnext.c which exists for safely swapping out the VM while there
is work in-flight on a context.
So, clearly people knew that this API was inherently racy and difficult to
implement but they landed it anyway. Why? The best explanation I've been
given is because it makes the API more "unified" or "symmetric" for this
stuff to go through SET_CONTEXT_PARAM. It's not because any userspace
actually wants to be able to swap out the VM or the set of engines on a
running context. That would be utterly insane.
This patch series cleans up this particular mess by introducing the concept
of a i915_gem_proto_context data structure which contains context creation
information. When you initially call GEM_CONTEXT_CREATE, a proto-context
in created instead of an actual context. Then, the first time something is
done on the context besides SET_CONTEXT_PARAM, an actual context is
created. This allows us to keep the old drivers which use
SET_CONTEXT_PARAM to set up the engine set (see also media) while ensuring
that, once you have an i915_gem_context, the VM and the engine set are
immutable state.
Eventually, there are more clean-ups I'd like to do on top of this which
should make working with contexts inside i915 simpler and safer:
1. Move the GEM handle -> vma LUT from i915_gem_context into either
i915_ppgtt or drm_i915_file_private depending on whether or not the
hardware has a full PPGTT.
2. Move the delayed context destruction code into intel_context or a
per-engine wrapper struct rather than i915_gem_context.
3. Get rid of the separation between context close and context destroy
4. Get rid of the RCU on i915_gem_context
However, these should probably be done as a separate patch series as this
one is already starting to get longish, especially if you consider the 89
IGT patches that go along with it.
Test-with: 20210707210215.351483-1-jason(a)jlekstrand.net
Jason Ekstrand (30):
drm/i915: Drop I915_CONTEXT_PARAM_RINGSIZE
drm/i915: Stop storing the ring size in the ring pointer (v3)
drm/i915: Drop I915_CONTEXT_PARAM_NO_ZEROMAP
drm/i915/gem: Set the watchdog timeout directly in
intel_context_set_gem (v2)
drm/i915/gem: Return void from context_apply_all
drm/i915: Drop the CONTEXT_CLONE API (v2)
drm/i915: Implement SINGLE_TIMELINE with a syncobj (v4)
drm/i915: Drop getparam support for I915_CONTEXT_PARAM_ENGINES
drm/i915/gem: Disallow bonding of virtual engines (v3)
drm/i915/gem: Remove engine auto-magic with FENCE_SUBMIT (v2)
drm/i915/request: Remove the hook from await_execution
drm/i915/gem: Disallow creating contexts with too many engines
drm/i915: Stop manually RCU banging in reset_stats_ioctl (v2)
drm/i915/gem: Add a separate validate_priority helper
drm/i915: Add gem/i915_gem_context.h to the docs
drm/i915/gem: Add an intermediate proto_context struct (v5)
drm/i915/gem: Rework error handling in default_engines
drm/i915/gem: Optionally set SSEU in intel_context_set_gem
drm/i915: Add an i915_gem_vm_lookup helper
drm/i915/gem: Make an alignment check more sensible
drm/i915/gem: Use the proto-context to handle create parameters (v5)
drm/i915/gem: Return an error ptr from context_lookup
drm/i915/gt: Drop i915_address_space::file (v2)
drm/i915/gem: Delay context creation (v3)
drm/i915/gem: Don't allow changing the VM on running contexts (v4)
drm/i915/gem: Don't allow changing the engine set on running contexts
(v3)
drm/i915/selftests: Take a VM in kernel_context()
i915/gem/selftests: Assign the VM at context creation in
igt_shared_ctx_exec
drm/i915/gem: Roll all of context creation together
drm/i915: Finalize contexts in GEM_CONTEXT_CREATE on version 13+
Documentation/gpu/i915.rst | 2 +
drivers/gpu/drm/i915/Makefile | 1 -
drivers/gpu/drm/i915/gem/i915_gem_context.c | 2926 ++++++++---------
drivers/gpu/drm/i915/gem/i915_gem_context.h | 3 +
.../gpu/drm/i915/gem/i915_gem_context_types.h | 196 +-
.../gpu/drm/i915/gem/i915_gem_execbuffer.c | 31 +-
.../drm/i915/gem/selftests/i915_gem_context.c | 127 +-
.../gpu/drm/i915/gem/selftests/mock_context.c | 67 +-
.../gpu/drm/i915/gem/selftests/mock_context.h | 4 +-
drivers/gpu/drm/i915/gt/intel_context.c | 3 +-
drivers/gpu/drm/i915/gt/intel_context.h | 5 -
drivers/gpu/drm/i915/gt/intel_context_param.c | 63 -
drivers/gpu/drm/i915/gt/intel_context_param.h | 6 +-
drivers/gpu/drm/i915/gt/intel_context_types.h | 1 +
drivers/gpu/drm/i915/gt/intel_engine_cs.c | 3 +-
drivers/gpu/drm/i915/gt/intel_engine_types.h | 7 -
.../drm/i915/gt/intel_execlists_submission.c | 114 -
.../drm/i915/gt/intel_execlists_submission.h | 8 +-
drivers/gpu/drm/i915/gt/intel_gtt.h | 11 -
drivers/gpu/drm/i915/gt/intel_lrc.c | 2 +-
drivers/gpu/drm/i915/gt/intel_migrate.c | 3 +-
drivers/gpu/drm/i915/gt/selftest_execlists.c | 251 +-
drivers/gpu/drm/i915/gt/selftest_hangcheck.c | 2 +-
drivers/gpu/drm/i915/gt/selftest_mocs.c | 2 +-
drivers/gpu/drm/i915/gt/selftest_timeline.c | 2 +-
drivers/gpu/drm/i915/gvt/scheduler.c | 7 +-
drivers/gpu/drm/i915/i915_drv.h | 82 +-
drivers/gpu/drm/i915/i915_perf.c | 4 +-
drivers/gpu/drm/i915/i915_request.c | 42 +-
drivers/gpu/drm/i915/i915_request.h | 4 +-
.../drm/i915/selftests/i915_mock_selftests.h | 1 -
drivers/gpu/drm/i915/selftests/mock_gtt.c | 1 -
include/uapi/drm/i915_drm.h | 40 +-
33 files changed, 1681 insertions(+), 2340 deletions(-)
delete mode 100644 drivers/gpu/drm/i915/gt/intel_context_param.c
--
2.31.1
[View Less]
This series introduces support for the LogiCVC display controller.
The controller is a bit unusual since it is usually loaded as
programmable logic on Xilinx FPGAs or Zynq-7000 SoCs.
More details are presented on the main commit for the driver.
More information about the controller is available on the dedicated
web page: https://www.logicbricks.com/Products/logiCVC-ML.aspx
Note that this driver has rather simple connector management, which was
not converted to drm_panel_bridge to keep the …
[View More]ability to enable the panel
at first vblank but also to support DVI.
Changes since v8:
- Rebased on top of the latest drm-misc-next;
- Dropped useless phandle-based syscon regmap support;
- Switched to a single-port graph description;
- Updated the device-tree schema to the port schema and added a
description for the port.
Change since v7:
- Replaced DRM_INFO/DRM_ERROR/DRM_DEBUG_DRIVER with fashions using drm_device;
- Fixed yaml binding alignment issue;
- Renamed logicvc-display name to the generic "display" name;
- Added patternProperties match for display in the parent mfd binding;
- Used drm_atomic_get_new_crtc_state when needed;
- Checked mode in mode_valid instead of atomic_check;
- Switched to drmm_mode_config_init;
- Removed useless logicvc_connector_destroy wrapper;
- Removed useless drm_dev_put calls;
- Removed atomic_commit_tail that enables the panel and streamlined the logic;
- Reworked Makefile cosmetics;
- Fixed checkpatch issues.
Changes since v6:
- Updated to the latest DRM internal API changes;
- Used an enum to index dt properties instead of the name string.
Changes since v5:
- Subclass DRM device and use devm_drm_dev_alloc for allocation;
- Removed call to drm_mode_config_cleanup (done automatically with devm);
- Some related code cleanups;
- Bring back not-for-merge patch adding colorkey support.
Changes since v4:
- Updated to internal DRM API changes (rebased on drm-misc-next);
- Added Kconfig dependency on OF;
- Added MAINTAINERS entry;
- Used drm_err and dev_err instead of DRM_ERROR where possible;
- Various cosmetic changes.
Changes since v3:
- Rebased on latest drm-misc;
- Improved event lock wrapping;
- Added collect tag;
- Added color-key support patch (not for merge, for reference only).
Changes since v2:
- Fixed and slightly improved dt schema.
Changes since v1:
- Switched dt bindings documentation to dt schema;
- Described more possible dt parameters;
- Added support for the lvds-3bit interface;
- Added support for grabbing syscon regmap from parent node;
- Removed layers count property and count layers child nodes instead.
Paul Kocialkowski (4):
dt-bindings: display: Document the Xylon LogiCVC display controller
dt-bindings: mfd: logicvc: Add patternProperties for the display
drm: Add support for the LogiCVC display controller
NOTFORMERGE: drm/logicvc: Add plane colorkey support
.../display/xylon,logicvc-display.yaml | 302 +++++++
.../bindings/mfd/xylon,logicvc.yaml | 3 +
MAINTAINERS | 6 +
drivers/gpu/drm/Kconfig | 2 +
drivers/gpu/drm/Makefile | 1 +
drivers/gpu/drm/logicvc/Kconfig | 9 +
drivers/gpu/drm/logicvc/Makefile | 9 +
drivers/gpu/drm/logicvc/logicvc_crtc.c | 280 +++++++
drivers/gpu/drm/logicvc/logicvc_crtc.h | 21 +
drivers/gpu/drm/logicvc/logicvc_drm.c | 471 +++++++++++
drivers/gpu/drm/logicvc/logicvc_drm.h | 67 ++
drivers/gpu/drm/logicvc/logicvc_interface.c | 214 +++++
drivers/gpu/drm/logicvc/logicvc_interface.h | 28 +
drivers/gpu/drm/logicvc/logicvc_layer.c | 767 ++++++++++++++++++
drivers/gpu/drm/logicvc/logicvc_layer.h | 71 ++
drivers/gpu/drm/logicvc/logicvc_mode.c | 80 ++
drivers/gpu/drm/logicvc/logicvc_mode.h | 15 +
drivers/gpu/drm/logicvc/logicvc_of.c | 185 +++++
drivers/gpu/drm/logicvc/logicvc_of.h | 46 ++
drivers/gpu/drm/logicvc/logicvc_regs.h | 88 ++
20 files changed, 2665 insertions(+)
create mode 100644 Documentation/devicetree/bindings/display/xylon,logicvc-display.yaml
create mode 100644 drivers/gpu/drm/logicvc/Kconfig
create mode 100644 drivers/gpu/drm/logicvc/Makefile
create mode 100644 drivers/gpu/drm/logicvc/logicvc_crtc.c
create mode 100644 drivers/gpu/drm/logicvc/logicvc_crtc.h
create mode 100644 drivers/gpu/drm/logicvc/logicvc_drm.c
create mode 100644 drivers/gpu/drm/logicvc/logicvc_drm.h
create mode 100644 drivers/gpu/drm/logicvc/logicvc_interface.c
create mode 100644 drivers/gpu/drm/logicvc/logicvc_interface.h
create mode 100644 drivers/gpu/drm/logicvc/logicvc_layer.c
create mode 100644 drivers/gpu/drm/logicvc/logicvc_layer.h
create mode 100644 drivers/gpu/drm/logicvc/logicvc_mode.c
create mode 100644 drivers/gpu/drm/logicvc/logicvc_mode.h
create mode 100644 drivers/gpu/drm/logicvc/logicvc_of.c
create mode 100644 drivers/gpu/drm/logicvc/logicvc_of.h
create mode 100644 drivers/gpu/drm/logicvc/logicvc_regs.h
--
2.32.0
[View Less]
Hello,
Kernel 5.14.12 introduced this change, git commit
ec7cc3f74b4236860ce612656aa5be7936d1c594:
--- a/linux-5.14.11/drivers/video/fbdev/Kconfig
+++ b/linux-5.14.12/drivers/video/fbdev/Kconfig
@@ -2191,8 +2191,9 @@ config FB_HYPERV
This framebuffer driver supports Microsoft Hyper-V Synthetic Video.
config FB_SIMPLE
- bool "Simple framebuffer support"
- depends on (FB = y) && !DRM_SIMPLEDRM
+ tristate "Simple framebuffer support"
+ depends on FB
+ depends on !…
[View More]DRM_SIMPLEDRM
select FB_CFB_FILLRECT
select FB_CFB_COPYAREA
select FB_CFB_IMAGEBLIT
However if you enable CONFIG_DRM_SIMPLEDRM=y along with it, the system
will show a black screen on boot while logging these messages:
[drm] Initialized simpledrm 1.0.0 20200625 for simple-framebuffer.0 on
minor 0
simple-framebuffer simple-framebuffer.0: [drm] *ERROR* fbdev: Failed to
setup generic emulation (ret=-22)
fbcon: Taking over console
When CONFIG_DRM_SIMPLEDRM is disabled it proceeds to boot normally:
simple-framebuffer simple-framebuffer.0: framebuffer at 0xe1000000,
0x300000 bytes
simple-framebuffer simple-framebuffer.0: format=a8r8g8b8,
mode=1024x768x32, linelength=4096
fbcon: Deferring console take-over
simple-framebuffer simple-framebuffer.0: fb0: simplefb registered!
This is discussed here: https://bugzilla.kernel.org/show_bug.cgi?id=214723
I really don't know what to make of it but I definitely don't like this
situation.
Best regards,
Artem
[View Less]
Only GPU that has larger SMMU region size (0x8000 dwords) is A530.
All other GPUs have 0x4000 SMMU region. However those GPUs work
correctly with larger range protected because there is no known
registers after SMMU region.
This patch needs to be backported to stable releases because A540 GPU
was forgotten to get its branch (that would set up protected region of
0x4000 dwords).
Fixes: b5f103ab98c7 ("drm/msm: gpu: Add A5XX target support")
Signed-off-by: Vladimir Lypak <vladimir.lypak(a)…
[View More]gmail.com>
---
drivers/gpu/drm/msm/adreno/a5xx_gpu.c | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/drivers/gpu/drm/msm/adreno/a5xx_gpu.c b/drivers/gpu/drm/msm/adreno/a5xx_gpu.c
index 5e2750eb3810..ecf6318a247f 100644
--- a/drivers/gpu/drm/msm/adreno/a5xx_gpu.c
+++ b/drivers/gpu/drm/msm/adreno/a5xx_gpu.c
@@ -851,11 +851,8 @@ static int a5xx_hw_init(struct msm_gpu *gpu)
/* UCHE */
gpu_write(gpu, REG_A5XX_CP_PROTECT(16), ADRENO_PROTECT_RW(0xE80, 16));
- if (adreno_is_a508(adreno_gpu) || adreno_is_a509(adreno_gpu) ||
- adreno_is_a510(adreno_gpu) || adreno_is_a512(adreno_gpu) ||
- adreno_is_a530(adreno_gpu))
- gpu_write(gpu, REG_A5XX_CP_PROTECT(17),
- ADRENO_PROTECT_RW(0x10000, 0x8000));
+ /* SMMU */
+ gpu_write(gpu, REG_A5XX_CP_PROTECT(17), ADRENO_PROTECT_RW(0x10000, 0x8000));
gpu_write(gpu, REG_A5XX_RBBM_SECVID_TSB_CNTL, 0);
/*
--
2.33.0
[View Less]
I forgot to do this properly in
commit 6f11f37459d8f9f74ff1c299c0bedd50b458057a
Author: Daniel Vetter <daniel.vetter(a)ffwll.ch>
Date: Fri Jul 23 10:34:55 2021 +0200
drm/plane: remove drm_helper_get_plane_damage_clips
intel-gfx CI didn't spot this because we run each selftest in each own
invocations, which means reloading i915.ko. But if you just run all
the selftests in one go at boot-up, then it falls apart and eventually
we cross over the hardcoded limited of how many …
[View More]properties can be
attached to a single object.
Fix this by resetting the property count. Nothing else to clean up
since it's all static storage anyway.
Reported-and-tested-by: Sebastian Andrzej Siewior <bigeasy(a)linutronix.de>
Cc: Sebastian Andrzej Siewior <bigeasy(a)linutronix.de>
Fixes: 6f11f37459d8 ("drm/plane: remove drm_helper_get_plane_damage_clips")
Cc: José Roberto de Souza <jose.souza(a)intel.com>
Cc: Ville Syrjälä <ville.syrjala(a)linux.intel.com>
Cc: Gwan-gyeong Mun <gwan-gyeong.mun(a)intel.com>
Cc: Hans de Goede <hdegoede(a)redhat.com>
Cc: Daniel Vetter <daniel.vetter(a)intel.com>
Cc: Maarten Lankhorst <maarten.lankhorst(a)linux.intel.com>
Cc: Maxime Ripard <mripard(a)kernel.org>
Cc: Thomas Zimmermann <tzimmermann(a)suse.de>
Signed-off-by: Daniel Vetter <daniel.vetter(a)intel.com>
---
drivers/gpu/drm/selftests/test-drm_damage_helper.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/gpu/drm/selftests/test-drm_damage_helper.c b/drivers/gpu/drm/selftests/test-drm_damage_helper.c
index 1c19a5d3eefb..8d8d8e214c28 100644
--- a/drivers/gpu/drm/selftests/test-drm_damage_helper.c
+++ b/drivers/gpu/drm/selftests/test-drm_damage_helper.c
@@ -30,6 +30,7 @@ static void mock_setup(struct drm_plane_state *state)
mock_device.driver = &mock_driver;
mock_device.mode_config.prop_fb_damage_clips = &mock_prop;
mock_plane.dev = &mock_device;
+ mock_obj_props.count = 0;
mock_plane.base.properties = &mock_obj_props;
mock_prop.base.id = 1; /* 0 is an invalid id */
mock_prop.dev = &mock_device;
--
2.33.0
[View Less]
We left the definition IS_CANNONLAKE() macro while removing it from the
tree due to having to merge the changes in different branches. Now that
everything is back in sync and nobody is using IS_CANNONLAKE(), we can
safely ditch it.
Signed-off-by: Lucas De Marchi <lucas.demarchi(a)intel.com>
---
drivers/gpu/drm/i915/i915_drv.h | 1 -
1 file changed, 1 deletion(-)
diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index 357faa043b3a..5e23c0273cf0 100644
--- a/…
[View More]drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -1431,7 +1431,6 @@ IS_SUBPLATFORM(const struct drm_i915_private *i915,
#define IS_GEMINILAKE(dev_priv) IS_PLATFORM(dev_priv, INTEL_GEMINILAKE)
#define IS_COFFEELAKE(dev_priv) IS_PLATFORM(dev_priv, INTEL_COFFEELAKE)
#define IS_COMETLAKE(dev_priv) IS_PLATFORM(dev_priv, INTEL_COMETLAKE)
-#define IS_CANNONLAKE(dev_priv) 0
#define IS_ICELAKE(dev_priv) IS_PLATFORM(dev_priv, INTEL_ICELAKE)
#define IS_JSL_EHL(dev_priv) (IS_PLATFORM(dev_priv, INTEL_JASPERLAKE) || \
IS_PLATFORM(dev_priv, INTEL_ELKHARTLAKE))
--
2.33.1
[View Less]