From: Jiri Kosina <jkosina(a)suse.cz>
In case when psp_init_asd_microcode() fails to load ASD microcode file,
psp_v12_0_init_microcode() tries to print the firmware filename that
failed to load before bailing out.
This is wrong because:
- the firmware filename it would want it print is an incorrect one as
psp_init_asd_microcode() and psp_v12_0_init_microcode() are loading
different filenames
- it tries to print fw_name, but that's not yet been initialized by that
time, so it …
[View More]prints random stack contents, e.g.
amdgpu 0000:04:00.0: Direct firmware load for amdgpu/renoir_asd.bin failed with error -2
amdgpu 0000:04:00.0: amdgpu: fail to initialize asd microcode
amdgpu 0000:04:00.0: amdgpu: psp v12.0: Failed to load firmware "\xfeTO\x8e\xff\xff"
Fix that by bailing out immediately, instead of priting the bogus error
message.
Reported-by: Vojtech Pavlik <vojtech(a)ucw.cz>
Signed-off-by: Jiri Kosina <jkosina(a)suse.cz>
---
drivers/gpu/drm/amd/amdgpu/psp_v12_0.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/psp_v12_0.c b/drivers/gpu/drm/amd/amdgpu/psp_v12_0.c
index c4828bd3264b..5b21e22ad4b9 100644
--- a/drivers/gpu/drm/amd/amdgpu/psp_v12_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/psp_v12_0.c
@@ -67,7 +67,7 @@ static int psp_v12_0_init_microcode(struct psp_context *psp)
err = psp_init_asd_microcode(psp, chip_name);
if (err)
- goto out;
+ return err;
snprintf(fw_name, sizeof(fw_name), "amdgpu/%s_ta.bin", chip_name);
err = request_firmware(&adev->psp.ta_fw, fw_name, adev->dev);
--
2.12.3
--
Jiri Kosina
SUSE Labs
[View Less]
Remove references to struct drm_device.irq_enabled from modern
DRM drivers and core.
KMS drivers enable IRQs for their devices internally. They don't
have to keep track of the IRQ state via irq_enabled. For vblanking,
it's cleaner to test for vblanking support directly than to test
for enabled IRQs.
The first 3 patches replace uses of irq_enabled that are not
required.
Patch 4 fixes vblank ioctls to actually test for vblank support
instead of IRQs (for KMS drivers).
The rest of the patchset …
[View More]removes irq_enabled from all non-legacy
drivers. The only exceptions are i915 and omapdrm, which have an
internal dpendency on the field's value. For these drivers, the
state gets duplicated internally.
With the patchset applied, drivers can later switch over to plain
Linux IRQ interfaces and DRM's IRQ midlayer can be declared legacy.
v3:
* update armada, i915, rcar-du and vkms as well (Laurent)
* optimize drm_wait_vblank_ioctl() for KMS (Liviu)
* move imx/dcss changes into their own patch (Laurentiu)
* doc cleanups
v2:
* keep the original test for legacy drivers in
drm_wait_vblank_ioctl() (Daniel)
Thomas Zimmermann (27):
drm/amdgpu: Track IRQ state in local device state
drm/hibmc: Call drm_irq_uninstall() unconditionally
drm/radeon: Track IRQ state in local device state
drm: Don't test for IRQ support in VBLANK ioctls
drm/armada: Don't set struct drm_device.irq_enabled
drm/i915: Track IRQ state in local device state
drm/komeda: Don't set struct drm_device.irq_enabled
drm/malidp: Don't set struct drm_device.irq_enabled
drm/exynos: Don't set struct drm_device.irq_enabled
drm/kirin: Don't set struct drm_device.irq_enabled
drm/imx: Don't set struct drm_device.irq_enabled
drm/imx/dcss: Don't set struct drm_device.irq_enabled
drm/mediatek: Don't set struct drm_device.irq_enabled
drm/nouveau: Don't set struct drm_device.irq_enabled
drm/omapdrm: Track IRQ state in local device state
drm/rcar-du: Don't set struct drm_device.irq_enabled
drm/rockchip: Don't set struct drm_device.irq_enabled
drm/sti: Don't set struct drm_device.irq_enabled
drm/stm: Don't set struct drm_device.irq_enabled
drm/sun4i: Don't set struct drm_device.irq_enabled
drm/tegra: Don't set struct drm_device.irq_enabled
drm/tidss: Don't use struct drm_device.irq_enabled
drm/vc4: Don't set struct drm_device.irq_enabled
drm/vkms: Don't set struct drm_device.irq_enabled
drm/vmwgfx: Don't set struct drm_device.irq_enabled
drm/xlnx: Don't set struct drm_device.irq_enabled
drm/zte: Don't set struct drm_device.irq_enabled
drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c | 6 +++---
drivers/gpu/drm/arm/display/komeda/komeda_kms.c | 4 ----
drivers/gpu/drm/arm/malidp_drv.c | 4 ----
drivers/gpu/drm/armada/armada_drv.c | 2 --
drivers/gpu/drm/drm_irq.c | 13 ++++---------
drivers/gpu/drm/drm_vblank.c | 16 ++++++++++++----
drivers/gpu/drm/exynos/exynos_drm_drv.c | 10 ----------
drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c | 3 +--
drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c | 2 --
drivers/gpu/drm/i915/i915_drv.h | 2 ++
drivers/gpu/drm/i915/i915_irq.c | 8 ++++----
drivers/gpu/drm/imx/dcss/dcss-kms.c | 3 ---
drivers/gpu/drm/imx/imx-drm-core.c | 11 -----------
drivers/gpu/drm/mediatek/mtk_drm_drv.c | 6 ------
drivers/gpu/drm/nouveau/nouveau_drm.c | 3 ---
drivers/gpu/drm/omapdrm/omap_drv.h | 2 ++
drivers/gpu/drm/omapdrm/omap_irq.c | 6 +++---
drivers/gpu/drm/radeon/radeon_fence.c | 2 +-
drivers/gpu/drm/radeon/radeon_irq_kms.c | 16 ++++++++--------
drivers/gpu/drm/rcar-du/rcar_du_drv.c | 2 --
drivers/gpu/drm/rockchip/rockchip_drm_drv.c | 6 ------
drivers/gpu/drm/sti/sti_compositor.c | 2 --
drivers/gpu/drm/stm/ltdc.c | 3 ---
drivers/gpu/drm/sun4i/sun4i_drv.c | 2 --
drivers/gpu/drm/tegra/drm.c | 7 -------
drivers/gpu/drm/tidss/tidss_irq.c | 3 ---
drivers/gpu/drm/vc4/vc4_kms.c | 1 -
drivers/gpu/drm/vkms/vkms_drv.c | 2 --
drivers/gpu/drm/vmwgfx/vmwgfx_irq.c | 8 --------
drivers/gpu/drm/xlnx/zynqmp_dpsub.c | 2 --
drivers/gpu/drm/zte/zx_drm_drv.c | 6 ------
31 files changed, 40 insertions(+), 123 deletions(-)
base-commit: 8c1323b422f8473421682ba783b5949ddd89a3f4
prerequisite-patch-id: c2b2f08f0eccc9f5df0c0da49fa1d36267deb11d
prerequisite-patch-id: c67e5d886a47b7d0266d81100837557fda34cb24
--
2.32.0
[View Less]
Reinstate the mmap ioctl for all current integrated platforms.
The intention was really to have it disabled for discrete graphics
where we enforce a single mmap mode.
Fixes: 35cbd91eb541 ("drm/i915: Disable mmap ioctl for gen12+")
Signed-off-by: Thomas Hellström <thomas.hellstrom(a)linux.intel.com>
---
drivers/gpu/drm/i915/gem/i915_gem_mman.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/drivers/gpu/drm/i915/gem/i915_gem_mman.c b/drivers/gpu/drm/i915/gem/…
[View More]i915_gem_mman.c
index 2fd155742bd2..09b5ed018aaf 100644
--- a/drivers/gpu/drm/i915/gem/i915_gem_mman.c
+++ b/drivers/gpu/drm/i915/gem/i915_gem_mman.c
@@ -62,10 +62,11 @@ i915_gem_mmap_ioctl(struct drm_device *dev, void *data,
struct drm_i915_gem_object *obj;
unsigned long addr;
- /* mmap ioctl is disallowed for all platforms after TGL-LP. This also
- * covers all platforms with local memory.
+ /*
+ * mmap ioctl is disallowed for all discrete platforms, and for
+ * and for all platforms with GRAPHICS_VER > 12.
*/
- if (GRAPHICS_VER(i915) >= 12 && !IS_TIGERLAKE(i915))
+ if (IS_DGFX(i915) || GRAPHICS_VER(i915) > 12)
return -EOPNOTSUPP;
if (args->flags & ~(I915_MMAP_WC))
--
2.31.1
[View Less]
Hello,
I'm resubmitting a patch submitted by Steven a long time ago. Not much
has changed except I realized I'd have to deal with soft-stops to
prevent this HW job queuing feature from killing innocent jobs when
a GPU hang happens. If we don't do that and a non-faulty job was in
progress when the GPU is reset, job headers might end up in an
inconsistent state, preventing them from being re-submitted after
the reset.
Also added an extra patch to use a threaded interrupt for job events
to avoid …
[View More]unneeded interrupt-context switches when short jobs are
queued.
Regards,
Boris
Boris Brezillon (1):
drm/panfrost: Use a threaded IRQ for job interrupts
Steven Price (1):
drm/panfrost: Queue jobs on the hardware
drivers/gpu/drm/panfrost/panfrost_device.h | 2 +-
drivers/gpu/drm/panfrost/panfrost_job.c | 357 ++++++++++++++++-----
2 files changed, 275 insertions(+), 84 deletions(-)
--
2.31.1
[View Less]
Am 24.06.21 um 10:12 schrieb Christoph Hellwig:
> On Thu, Jun 24, 2021 at 10:07:14AM +0200, Christian König wrote:
>> The key point is that accessing the underlying pages even when DMA-bufs are
>> backed by system memory is illegal. Daniel even created a patch which
>> mangles the page pointers in sg_tables used by DMA-buf to make sure that
>> people don't try to use them.
> Which is another goddamn layering violation of a subsystem that has no
> business at all …
[View More]poking into the scatterlist structure, yes.
Completely agree, but it is also the easiest way to get away from the
scatterlist as trasnport vehicle for the dma_addresses.
[SNIP]
>> My best plan to get out of this mess is that we change the DMA-buf
>> interface to use an array of dma_addresses instead of the sg_table object
>> and I have already been working on this actively the last few month.
> Awesome! I have a bit of related work on the DMA mapping subsystems, so
> let's sync up as soon as you have some first sketches.
Don't start cheering to fast.
I've already converted a bunch of the GPU drivers, but there are at
least 6 GPU still needing to be fixed and on top of that comes VA-API
and a few others.
What are your plans for the DMA mapping subsystem?
> Btw, one thing I noticed when looking over the dma-buf instances is that
> there is a lot of duplicated code for creating a sg_table from pages,
> and then mapping it. It would be good if we could move toward common
> helpers instead of duplicating that all over again.
Can you give an example?
Thanks,
Christian.
[View Less]
Early implementation of moving system memory for discrete cards over to
TTM. We first add the notion of objects being migratable under the object
lock to i915 gem, and add some asserts to verify that objects are either
locked or pinned when the placement is checked by the gem code.
Patch 2 deals with updating the i915 gem bookkeeping after a TTM move,
Patch 3 moves system over from shmem to TTM for discrete
Note that the mock device doesn't consider itself discrete so the TTM
system path is …
[View More]not checked by the mock selftests.
v2:
- Style fixes (reported by Matthew Auld)
- Drop the last patch (migration) It needs selftests and some additional work.
- Unconditionally add VM_IO at mmap time.
v3:
- More style fixes (reported by Matthew Auld)
- Don't overfill the busy placement vector (reported by Matthew Auld)
v4:
- Remove confusion around shrinkable objects (reported by Matthew Auld)
v5:
- Remove confusion around shrinkable objects again, but this time in the
correct patch. (reported by Matthew Auld)
v6:
- One patch already committed.
- Introduce a __i915_gem_object_is_lmem() to be used in situations where we
know that a fence that can't currently signal keeps the object from being
migrated or evicted.
- Rebase on accelerated TTM moves
- Fix TODO:s for supporting system memory with TTM.
- Update the object GEM region after a TTM move if compatible.
- Move a couple of warnings for shmem on DGFX.
v7:
- Just updated a commit message with version history under dashes.
v8:
- Reinstate alignment at ttm_bo_init_reserved() time. (Reported by
Matthew Auld).
- When changing regions, also move the object to the new region list
and break early. (Reported by Matthew Auld).
- Don't flag the object as contiguous based on the current region min
pages size.
v9:
- Remove a DGFX warning in __i915_gem_object_release_shmem since it
is called from the userptr code.
v10:
- Add some comments around the gem object "mem_flags" field, and
use a full unsigned int for it. (Suggested by Daniel Vetter).
- Add an object locked section while checking mem_flags in the live
mman selftest.
Thomas Hellström (3):
drm/i915: Update object placement flags to be mutable
drm/i915/ttm: Adjust gem flags and caching settings after a move
drm/i915/ttm: Use TTM for system memory
drivers/gpu/drm/i915/gem/i915_gem_internal.c | 4 +-
drivers/gpu/drm/i915/gem/i915_gem_lmem.c | 22 ++
drivers/gpu/drm/i915/gem/i915_gem_lmem.h | 2 +
drivers/gpu/drm/i915/gem/i915_gem_mman.c | 12 +-
drivers/gpu/drm/i915/gem/i915_gem_object.c | 38 ++++
drivers/gpu/drm/i915/gem/i915_gem_object.h | 14 +-
.../gpu/drm/i915/gem/i915_gem_object_types.h | 27 ++-
drivers/gpu/drm/i915/gem/i915_gem_pages.c | 2 +-
drivers/gpu/drm/i915/gem/i915_gem_phys.c | 2 +-
drivers/gpu/drm/i915/gem/i915_gem_region.c | 4 -
drivers/gpu/drm/i915/gem/i915_gem_shmem.c | 9 +-
drivers/gpu/drm/i915/gem/i915_gem_ttm.c | 196 ++++++++++++++----
drivers/gpu/drm/i915/gem/i915_gem_userptr.c | 4 +-
.../drm/i915/gem/selftests/huge_gem_object.c | 4 +-
.../gpu/drm/i915/gem/selftests/huge_pages.c | 5 +-
.../drm/i915/gem/selftests/i915_gem_mman.c | 25 ++-
.../drm/i915/gem/selftests/i915_gem_phys.c | 3 +-
drivers/gpu/drm/i915/i915_drv.h | 3 -
drivers/gpu/drm/i915/i915_gpu_error.c | 2 +-
drivers/gpu/drm/i915/intel_memory_region.c | 7 +-
drivers/gpu/drm/i915/intel_memory_region.h | 8 +
21 files changed, 288 insertions(+), 105 deletions(-)
--
2.31.1
[View Less]