Greg Kroah-Hartman
25746a3fa2
drm/i915: fix up merge with usb-next branch
...
In the manual fixup of the list_count_nodes() logic in
drivers/gpu/drm/i915/gt/intel_execlists_submission.c in the usb-next
branch, I missed that the print modifier was incorrect, resulting in
loads of build warnings on 32bit systems.
Fix this up by using "%su" instead of "%lu".
Reported-by: kernel test robot <lkp@intel.com >
Fixes: 924fb3ec50 ("Merge 6.2-rc7 into usb-next")
Link: https://lore.kernel.org/r/20230206124422.2266892-1-gregkh@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2023-02-06 13:46:05 +01:00
Matthew Auld
58c7ee0676
drm/i915/ttm: audit remaining bo->resource
...
In the near future TTM will have NULL bo->resource when the object is
initially created, plus after calling into pipeline-gutting. Try to
handle the remaining cases. In practice NULL bo->resource should be
taken to mean swapped-out or purged object.
v2 (Andrzej):
- Rather make i915_ttm_cpu_maps_iomem() return false with NULL
resource.
References: 516198d317 ("drm/i915: audit bo->resource usage v3")
Signed-off-by: Matthew Auld <matthew.auld@intel.com >
Cc: Nirmoy Das <nirmoy.das@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20230130101230.25347-2-matthew.auld@intel.com
Reviewed-by: Nirmoy Das <nirmoy.das@intel.com >
Reviewed-by: Andrzej Hajda <andrzej.hajda@intel.com >
Acked-by: Christian König <ckoenig.leichtzumerken@gmail.com >
Signed-off-by: Christian König <christian.koenig@amd.com >
2023-02-06 12:10:07 +01:00
Matthew Auld
fde789e833
drm/i915/ttm: fix sparse warning
...
Sparse complains with:
drivers/gpu/drm/i915/gem/i915_gem_ttm.c:1066:21: sparse:
expected restricted vm_fault_t [assigned] [usertype] ret
drivers/gpu/drm/i915/gem/i915_gem_ttm.c:1066:21: sparse: got int
Fixes: 516198d317 ("drm/i915: audit bo->resource usage v3")
Reported-by: kernel test robot <lkp@intel.com >
Signed-off-by: Matthew Auld <matthew.auld@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20230130101230.25347-1-matthew.auld@intel.com
Reviewed-by: Nirmoy Das <nirmoy.das@intel.com >
Acked-by: Christian König <ckoenig.leichtzumerken@gmail.com >
Signed-off-by: Christian König <christian.koenig@amd.com >
2023-02-06 12:09:58 +01:00
Aravind Iddamsetty
bca0d1d3ce
drm/i915: Initialize the obj flags for shmem objects
...
Obj flags for shmem objects is not being set correctly. Fixes in setting
BO_ALLOC_USER flag which applies to shmem objs as well.
v2: Add fixes tag (Tvrtko, Matt A)
Fixes: 13d29c8237 ("drm/i915/ehl: unconditionally flush the pages on acquire")
Cc: <stable@vger.kernel.org > # v5.15+
Cc: Matthew Auld <matthew.auld@intel.com >
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com >
Reviewed-by: Matthew Auld <matthew.auld@intel.com >
Signed-off-by: Aravind Iddamsetty <aravind.iddamsetty@intel.com >
Reviewed-by: Andrzej Hajda <andrzej.hajda@intel.com >
Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com >
[tursulin: Grouped all tags together.]
Link: https://patchwork.freedesktop.org/patch/msgid/20230203135205.4051149-1-aravind.iddamsetty@intel.com
2023-02-06 09:49:07 +00:00
Rob Clark
960dafa304
drm/i915: Move fd_install after last use of fence
...
Because eb_composite_fence_create() drops the fence_array reference
after creation of the sync_file, only the sync_file holds a ref to the
fence. But fd_install() makes that reference visable to userspace, so
it must be the last thing we do with the fence.
Signed-off-by: Rob Clark <robdclark@chromium.org >
Fixes: 00dae4d3d3 ("drm/i915: Implement SINGLE_TIMELINE with a syncobj (v4)")
Cc: <stable@vger.kernel.org > # v5.15+
[tursulin: Added stable tag.]
Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com >
Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20230203164937.4035503-1-robdclark@gmail.com
2023-02-06 09:38:54 +00:00
Greg Kroah-Hartman
924fb3ec50
Merge 6.2-rc7 into usb-next
...
We need the USB fixes in here, and this resolves a merge conflict with
the i915 driver as reported in linux-next
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2023-02-06 08:33:30 +01:00
Nirmoy Das
01f0411f8e
drm/i915: Make sure dsm_size has correct granularity
...
DSM granularity is 1MB so make sure we stick to that.
The address set by firmware in GEN12_DSMBASE in driver initialization
doesn't mean "anything above that and until end of lmem is part of DSM".
In fact, there may be a few KB that is not part of DSM on the end of
lmem. How large is that space is platform-dependent, but since it's
always less than the DSM granularity, it can be simplified by simply
aligning the size down.
v2: replace "1 * SZ_1M" with SZ_1M (Andrzej).
v3: reword commit message to explain why the round down is needed
(Lucas)
Cc: Matthew Auld <matthew.auld@intel.com >
Suggested-by: Lucas De Marchi <lucas.demarchi@intel.com >
Signed-off-by: Nirmoy Das <nirmoy.das@intel.com >
Reviewed-by: Andrzej Hajda <andrzej.hajda@intel.com >
Reviewed-by: Lucas De Marchi <lucas.demarchi@intel.com >
Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20230202180243.23637-1-nirmoy.das@intel.com
2023-02-03 15:53:19 -08:00
Ville Syrjälä
36e491f8f6
drm/i915/dsb: Introduce intel_dsb_finish()
...
Introduce a function to emits whatever commands we need
at the end of the DSB command buffer. For the moment we
only do the tail cacheline alignment there, but eventually
we might want to eg. emit an interrupt.
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20230118163040.29808-5-ville.syrjala@linux.intel.com
Reviewed-by: Animesh Manna <animesh.manna@intel.com >
2023-02-03 14:04:01 +02:00
Ville Syrjälä
4b284831c6
drm/i915/dsb: Split intel_dsb_wait() from intel_dsb_commit()
...
Starting the DSB execution vs. waiting for it stop are two
totally different things. Split intel_dsb_wait() from
intel_dsb_commit() so that we can eventually allow the DSB
to execute asynchronously.
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20230118163040.29808-4-ville.syrjala@linux.intel.com
Reviewed-by: Animesh Manna <animesh.manna@intel.com >
2023-02-03 13:57:30 +02:00
Ville Syrjälä
7206b51766
drm/i915/dsb: Pimp debug/error prints
...
Print the crtc/DSB id information to make it clear which DSB engine
we're talking about.
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20230118163040.29808-3-ville.syrjala@linux.intel.com
Reviewed-by: Animesh Manna <animesh.manna@intel.com >
2023-02-03 13:56:43 +02:00
Jouni Högander
1af546c2ce
drm/i915/fbdev: Implement fb_dirty for intel custom fb helper
...
After disconnecting damage worker from update logic it's left to fbdev
emulation implementation to have fb_dirty function. Currently intel
fbdev doesn't have it. This is causing problems to features (PSR, FBC,
DRRS) relying on dirty callback.
Implement simple fb_dirty callback to deliver notifications about updates
in fb console.
v4: Add proper Fixes tag and modify commit message
v3: Check damage clip
v2: Improved commit message and added Fixes tag
Fixes: f231af498c ("drm/fb-helper: Disconnect damage worker from update logic")
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com >
Cc: Thomas Zimmermann <tzimmermann@suse.de >
Cc: Jani Nikula <jani.nikula@intel.com >
Signed-off-by: Jouni Högander <jouni.hogander@intel.com >
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20230123074437.475103-1-jouni.hogander@intel.com
2023-02-03 13:17:27 +02:00
Michal Wajdeczko
5dfb29d444
drm/i915/guc: Improve debug message on context reset notification
...
Just recently we switched over to new GuC oriented log macros but in
the meantime yet another message was added that we missed to update.
While around improve that new message by adding engine name and use
existing helpers to check for context state.
Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com >
Cc: John Harrison <John.C.Harrison@Intel.com >
Reviewed-by: John Harrison <John.C.Harrison@Intel.com >
Signed-off-by: John Harrison <John.C.Harrison@Intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20230131214413.1879-1-michal.wajdeczko@intel.com
2023-02-02 15:13:19 -08:00
Jani Nikula
247c7a4cda
drm/i915/dmc: check incoming dmc id validity
...
Add validity checks for the dmc ids computed from pipe parameters in
intel_dmc_enable_pipe() and intel_dmc_disable_pipe(). It's slightly
difficult for humans and static analyzers alike to ensure the resulting
dmc ids are within bounds. Just check them and reject invalid ones.
Signed-off-by: Jani Nikula <jani.nikula@intel.com >
Reviewed-by: Imre Deak <imre.deak@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/6a349c3a2b2def5fc31a48c9844ebd72ee55a22b.1675339447.git.jani.nikula@intel.com
2023-02-02 21:34:21 +02:00
Jani Nikula
da97065e46
drm/i915/dmc: add is_valid_dmc_id() and use it
...
Add a name to the dmc id validity check.
Signed-off-by: Jani Nikula <jani.nikula@intel.com >
Reviewed-by: Imre Deak <imre.deak@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/311213ce328575a95d793a219d4dac7d947086cc.1675339447.git.jani.nikula@intel.com
2023-02-02 21:34:18 +02:00
Jani Nikula
3965b8812e
drm/i915/dmc: remove unnecessary dmc_id validity check
...
The dmc_id comes from for_each_dmc_id() in parse_dmc_fw() ->
parse_dmc_fw_header() -> dmc_mmio_addr_sanity_check(). It's valid by
definition.
Signed-off-by: Jani Nikula <jani.nikula@intel.com >
Reviewed-by: Imre Deak <imre.deak@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/b4e1c862687f79861a5fa4bfa6797ecda2136fab.1675339447.git.jani.nikula@intel.com
2023-02-02 21:34:14 +02:00
Jani Nikula
23cc452e9b
drm/i915/dmc: add for_each_dmc_id() and use it
...
The loop is duplicated many times, with slightly different ways. Unify.
Signed-off-by: Jani Nikula <jani.nikula@intel.com >
Reviewed-by: Imre Deak <imre.deak@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/8dcaa716093e6fbe75bb69ee7ac715a3f007a523.1675339447.git.jani.nikula@intel.com
2023-02-02 21:34:12 +02:00
Jani Nikula
e4ef6503bd
drm/i915/dmc: add proper name to dmc id enum and use it
...
Clarify DMC ID usage by adding enum intel_dmc_id name to the enum, and
use dmc_id as the variable name for it throughout.
Convert a switch-case to if-ladder to avoid warnings about not handling
DMC_FW_MAX enumeration constant in the switch-case.
Signed-off-by: Jani Nikula <jani.nikula@intel.com >
Reviewed-by: Imre Deak <imre.deak@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/6912ccb411bb957c68c108b774745dbc7e0cbdc2.1675339447.git.jani.nikula@intel.com
2023-02-02 21:33:59 +02:00
Dave Airlie
15a5744857
Merge tag 'drm-intel-gt-next-2023-02-01' of git://anongit.freedesktop.org/drm/drm-intel into drm-next
...
Driver Changes:
Fixes/improvements/new stuff:
- Fix bcs default context on Meteorlake (Lucas De Marchi)
- GAM registers don't need to be re-applied on engine resets (Matt Roper)
- Correct implementation of Wa_18018781329 (Matt Roper)
- Avoid potential vm use-after-free (Rob Clark)
- GuC error capture fixes (John Harrison)
- Fix potential bit_17 double-free (Rob Clark)
- Don't complain about missing regs on MTL (John Harrison)
Future platform enablement:
- Convert PSS_MODE2 to multicast register (Gustavo Sousa)
- Move/adjust register definitions related to Wa_22011450934 (Matt Roper)
- Move LSC_CHICKEN_BIT* workarounds to correct function (Gustavo Sousa)
- Document where to implement register workarounds (Gustavo Sousa)
- Use uabi engines for the default engine map (Tvrtko Ursulin)
- Flush all tiles on test exit (Tvrtko Ursulin)
- Annotate a couple more workaround registers as MCR (Matt Roper)
Driver refactors:
- Add and use GuC oriented print macros (Michal Wajdeczko)
Miscellaneous:
- Fix intel_selftest_modify_policy argument types (Arnd Bergmann)
Backmerges:
Merge drm/drm-next into drm-intel-gt-next (for conflict resolution) (Tvrtko Ursulin)
Signed-off-by: Dave Airlie <airlied@redhat.com >
From: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/Y9pOsq7VKnq7rgnW@tursulin-desk
2023-02-03 04:51:18 +10:00
Nirmoy Das
1f16fdbb2a
drm/i915/gt: Use sysfs_emit() and sysfs_emit_at()
...
Use sysfs_emit() and sysfs_emit_at() in show() callback
as recommended by Documentation/filesystems/sysfs.rst
Cc: Andi Shyti <andi.shyti@linux.intel.com >
Signed-off-by: Nirmoy Das <nirmoy.das@intel.com >
Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com >
Reviewed-by: Andi Shyti <andi.shyti@linux.intel.com >
Signed-off-by: Andi Shyti <andi.shyti@linux.intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20230130131358.16800-1-nirmoy.das@intel.com
2023-02-02 15:36:01 +01:00
Ville Syrjälä
14f25bd0bb
drm/i915: Expose SAGV state via debugfs
...
Since SAGV is controlled via unidirectional pcode commands
we have no way to query the current state. So instead let's
expose the last programmed state via debugfs. This way we
can at least know whether SAGV should be enabled or not
(which can be important to know when dealing with underruns/etc.).
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20230131002127.29305-4-ville.syrjala@linux.intel.com
Reviewed-by: Jani Nikula <jani.nikula@intel.com >
2023-02-01 22:07:27 +02:00
Ville Syrjälä
9541fd164b
drm/i915: Keep sagv status updated on icl+
...
On icl+ SAGV is controlled by masking of the QGV points.
Reduce the QGV point mask to the same kind of enabled vs.
disable information that we had on previous platforms.
Will be useful in answering the question whether SAGV is
actually enabled or not.
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20230131002127.29305-3-ville.syrjala@linux.intel.com
Reviewed-by: Stanislav Lisovskiy <stanislav.lisovskiy@intel.com >
2023-02-01 22:07:03 +02:00
Ville Syrjälä
43e6fad17a
drm/i915: Introduce HAS_SAGV()
...
Introuce a HAS_SAGV() macro to answer the question whether
the platform in general supports SAGV. intel_has_sagv() will
keep on giving us the more specific answer whether the current
device supports SAGV or not.
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20230131002127.29305-2-ville.syrjala@linux.intel.com
Reviewed-by: Jani Nikula <jani.nikula@intel.com >
2023-02-01 22:06:07 +02:00
Ville Syrjälä
c580c2d27a
drm/i915: Don't do the WM0->WM1 copy w/a if WM1 is already enabled
...
Due to a workaround we have to make sure the WM1 watermarks block/lines
values are sensible even when WM1 is disabled. To that end we copy those
values from WM0.
However since we now keep each wm level enabled on a per-plane basis
it doesn't seem necessary to do that copy when we already have an
enabled WM1 on the current plane. That is, we might be in a situation
where another plane can only do WM0 (and thus needs the copy) but
the current plane's WM1 is still perfectly valid (ie. fits into the
current DDB allocation).
Skipping the copy could avoid reprogramming the plane's registers
needlessly in some cases.
Fixes: a301cb0fca ("drm/i915: Keep plane watermarks enabled more aggressively")
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20230131002127.29305-1-ville.syrjala@linux.intel.com
Reviewed-by: Stanislav Lisovskiy <stanislav.lisovskiy@intel.com >
2023-02-01 22:05:48 +02:00
Chris Wilson
73a6c67654
drm/i915/gt: Add selftests for TLB invalidation
...
Check that we invalidate the TLB cache, the updated physical addresses
are immediately visible to the HW, and there is no retention of the old
physical address for concurrent HW access.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk >
[ahajda: adjust to upstream driver, v2+]
Signed-off-by: Andrzej Hajda <andrzej.hajda@intel.com >
Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com >
[tursulin: Small indentation fix.]
Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20230130165058.1647414-1-andrzej.hajda@intel.com
2023-02-01 16:17:41 +00:00
John Harrison
003e11ed2e
drm/i915/mtl: Wa_22011802037: don't complain about missing regs on MTL
...
Wa_22011802037 requires waiting for an engine-specific register to
clear. A missing entry for GSC engine in the register table is flagged
as a drm_err. The drm_err was originally intended to catch missing
register entries for newer engines, however, it was later found that the
WA is only required for 'legacy' engines. So just drop the drm_err.
Signed-off-by: John Harrison <John.C.Harrison@Intel.com >
Reviewed-by: Andrzej Hajda <andrzej.hajda@intel.com >
Signed-off-by: Umesh Nerlige Ramappa <umesh.nerlige.ramappa@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20230124231111.1786429-1-umesh.nerlige.ramappa@intel.com
2023-01-31 15:17:30 -08:00
Michal Wajdeczko
2f8c06cb66
drm/i915/guc: Update GT/GuC messages in intel_uc.c
...
Use new macros to have common prefix that also include GT#.
v2: pass gt to print_fw_ver
v3: prefer guc_dbg in suspend/resume logs
Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com >
Cc: John Harrison <John.C.Harrison@Intel.com >
Reviewed-by: John Harrison <John.C.Harrison@Intel.com >
Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20230128195907.1837-9-michal.wajdeczko@intel.com
2023-01-31 12:20:07 +00:00
Michal Wajdeczko
f0c4fc416e
drm/i915/guc: Update GuC messages in intel_guc_submission.c
...
Use new macros to have common prefix that also include GT#.
v2: improve few existing messages
Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com >
Cc: John Harrison <John.C.Harrison@Intel.com >
Reviewed-by: John Harrison <John.C.Harrison@Intel.com >
Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20230128195907.1837-8-michal.wajdeczko@intel.com
2023-01-31 12:20:06 +00:00
Michal Wajdeczko
357d420ef2
drm/i915/guc: Update GuC messages in intel_guc_log.c
...
Use new macros to have common prefix that also include GT#.
v2: drop redundant GuC strings, minor improvements
v3: more message improvements
Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com >
Cc: John Harrison <John.C.Harrison@Intel.com >
Reviewed-by: John Harrison <John.C.Harrison@Intel.com >
Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20230128195907.1837-7-michal.wajdeczko@intel.com
2023-01-31 12:20:06 +00:00
Michal Wajdeczko
d8ff108162
drm/i915/guc: Update GuC messages in intel_guc_fw.c
...
Use new macros to have common prefix that also include GT#.
Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com >
Cc: John Harrison <John.C.Harrison@Intel.com >
Reviewed-by: John Harrison <John.C.Harrison@Intel.com >
Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20230128195907.1837-6-michal.wajdeczko@intel.com
2023-01-31 12:20:05 +00:00
Michal Wajdeczko
7388acb253
drm/i915/guc: Update GuC messages in intel_guc_ct.c
...
Use new macros to have common prefix that also include GT#.
v2: drop unused helpers
Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com >
Cc: John Harrison <John.C.Harrison@Intel.com >
Reviewed-by: John Harrison <John.C.Harrison@Intel.com >
Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20230128195907.1837-5-michal.wajdeczko@intel.com
2023-01-31 12:20:05 +00:00
Michal Wajdeczko
140f9309d2
drm/i915/guc: Update GuC messages in intel_guc_ads.c
...
Use new macros to have common prefix that also include GT#.
Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com >
Cc: John Harrison <John.C.Harrison@Intel.com >
Reviewed-by: John Harrison <John.C.Harrison@Intel.com >
Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20230128195907.1837-4-michal.wajdeczko@intel.com
2023-01-31 12:20:05 +00:00
Michal Wajdeczko
ecb89c2c4d
drm/i915/guc: Update GuC messages in intel_guc.c
...
Use new macros to have common prefix that also include GT#.
v2: drop now redundant "GuC" word from the message
Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com >
Cc: John Harrison <John.C.Harrison@Intel.com >
Reviewed-by: John Harrison <John.C.Harrison@Intel.com >
Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20230128195907.1837-3-michal.wajdeczko@intel.com
2023-01-31 12:20:04 +00:00
Michal Wajdeczko
e03a9d4063
drm/i915/guc: Add GuC oriented print macros
...
While we do have GT oriented print macros, add few more GuC
specific to have common look and feel across all messages
related to the GuC and to avoid chasing the gt pointer.
We will use these macros shortly in upcoming patches.
Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com >
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com >
Cc: John Harrison <John.C.Harrison@Intel.com >
Reviewed-by: John Harrison <John.C.Harrison@Intel.com >
Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20230128195907.1837-2-michal.wajdeczko@intel.com
2023-01-31 12:20:03 +00:00
Daniel Vetter
aebd8f0c6f
Merge v6.2-rc6 into drm-next
...
Due to holidays we started -next with more -fixes in-flight than
usual, and people have been asking where they are. Backmerge to get
things better in sync.
Conflicts:
- Tiny conflict in drm_fbdev_generic.c between variable rename and
missing error handling that got added.
- Conflict in drm_fb_helper.c between the added call to vgaswitcheroo
in drm_fb_helper_single_fb_probe and a refactor patch that extracted
lots of helpers and incidentally removed the dev local variable.
Readd it to make things compile.
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch >
2023-01-31 12:23:23 +01:00
Ville Syrjälä
7fd7eacff0
drm/i915/lvds: s/pipe_config/crtc_state/
...
Call the crtc state 'crtc_state' rather than 'pipe_config',
as is the modern style.
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20230130180540.8972-9-ville.syrjala@linux.intel.com
Reviewed-by: Jani Nikula <jani.nikula@intel.com >
2023-01-31 11:24:06 +02:00
Ville Syrjälä
19d7dc6638
drm/i915/lvds: s/intel_encoder/encoder/ etc.
...
Get rid of some of the annoying aliasing drm_ vs.
intel_ encoder/connector variables. Just prefer the
intel_ types.
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20230130180540.8972-8-ville.syrjala@linux.intel.com
Reviewed-by: Jani Nikula <jani.nikula@intel.com >
2023-01-31 11:24:06 +02:00
Ville Syrjälä
7f66476c93
drm/i915/lvds: s/dev_priv/i915/
...
Do the customary s/dev_priv/i915/ rename and aliasing
'dev' pointer removal. Though various register definitions
still depend on the magic 'dev_priv' variable so not
a 100% conversion.
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20230130180540.8972-7-ville.syrjala@linux.intel.com
Reviewed-by: Jani Nikula <jani.nikula@intel.com >
2023-01-31 11:24:06 +02:00
Ville Syrjälä
77d3b61302
drm/i915/lvds: Fix whitespace
...
Replace some stray spaces with tabs.
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20230130180540.8972-6-ville.syrjala@linux.intel.com
Reviewed-by: Jani Nikula <jani.nikula@intel.com >
2023-01-31 11:24:06 +02:00
Ville Syrjälä
16bede135f
drm/i915/lvds: Extract intel_lvds_regs.h
...
Extract the integrated LVDS port register definitions
into their own header file.
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20230130180540.8972-5-ville.syrjala@linux.intel.com
Reviewed-by: Jani Nikula <jani.nikula@intel.com >
2023-01-31 11:24:06 +02:00
Ville Syrjälä
9dd56e979c
drm/i915/lvds: Use REG_BIT() & co.
...
Use REG_BIT() & co. for the LVDS port register.
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20230130180540.8972-4-ville.syrjala@linux.intel.com
Reviewed-by: Jani Nikula <jani.nikula@intel.com >
2023-01-31 11:24:06 +02:00
Ville Syrjälä
2324cdfffb
drm/i915/lvds: Use intel_de_rmw()
...
Replace the hand rolled rmw stuff with intel_de_rmw().
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20230130180540.8972-3-ville.syrjala@linux.intel.com
Reviewed-by: Jani Nikula <jani.nikula@intel.com >
2023-01-31 11:24:06 +02:00
Ville Syrjälä
c76f67275f
drm/i915/lvds: Split long lines
...
Split some overly long lines.
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20230130180540.8972-2-ville.syrjala@linux.intel.com
Reviewed-by: Jani Nikula <jani.nikula@intel.com >
2023-01-31 11:24:05 +02:00
Stanislav Lisovskiy
33d0c67dcb
drm/i915: Implement workaround for CDCLK PLL disable/enable
...
It was reported that we might get a hung and loss of register access in
some cases when CDCLK PLL is disabled and then enabled, while squashing
is enabled.
As a workaround it was proposed by HW team that SW should disable squashing
when CDCLK PLL is being reenabled.
v2: - Added WA number comment(Rodrigo Vivi)
Signed-off-by: Stanislav Lisovskiy <stanislav.lisovskiy@intel.com >
Reviewed-by: Anusha Srivatsa <anusha.srivatsa@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20230130135836.12738-1-stanislav.lisovskiy@intel.com
2023-01-31 10:55:02 +02:00
Ankit Nautiyal
9c608cf39b
drm/i915/hdmi: Go for scrambling only if platform supports TMDS clock > 340MHz
...
There are cases, where devices have an HDMI1.4 retimer, and TMDS clock rate
is capped to 340MHz via VBT. In such cases scrambling might be supported
by the platform and an HDMI2.0 sink for lower TMDS rates, but not
supported by the retimer, causing blankouts.
So avoid enabling scrambling, if the TMDS clock is capped to <= 340MHz.
v2: Added comment, documenting the rationale to check for TMDS clock,
before going for scrambling. (Arun)
v3: Fixed the function name to check if source supports scrambling. (Jani)
Signed-off-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com >
Reviewed-by: Arun R Murthy <arun.r.murthy@intel.com >
Signed-off-by: Uma Shankar <uma.shankar@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20221222040851.3029514-1-ankit.k.nautiyal@intel.com
2023-01-31 12:06:25 +05:30
Chaitanya Kumar Borah
47a2bd9d98
drm/i915/adlp: Fix typo for reference clock
...
Fix typo for reference clock from 24400 to 24000.
Bspec: 55409
Fixes: 626426ff9c ("drm/i915/adl_p: Add cdclk support for ADL-P")
Reviewed-by: Matt Roper <matthew.d.roper@intel.com >
Signed-off-by: Chaitanya Kumar Borah <chaitanya.kumar.borah@intel.com >
Signed-off-by: Jani Nikula <jani.nikula@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20230112094131.550252-1-chaitanya.kumar.borah@intel.com
(cherry picked from commit 2b6f7e39cc )
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com >
2023-01-30 15:48:30 -05:00
Rob Clark
7057a8f126
drm/i915: Fix potential bit_17 double-free
...
A userspace with multiple threads racing I915_GEM_SET_TILING to set the
tiling to I915_TILING_NONE could trigger a double free of the bit_17
bitmask. (Or conversely leak memory on the transition to tiled.) Move
allocation/free'ing of the bitmask within the section protected by the
obj lock.
Signed-off-by: Rob Clark <robdclark@chromium.org >
Fixes: 2850748ef8 ("drm/i915: Pull i915_vma_pin under the vm->mutex")
Cc: <stable@vger.kernel.org > # v5.5+
[tursulin: Correct fixes tag and added cc stable.]
Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com >
Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20230127200550.3531984-1-robdclark@gmail.com
(cherry picked from commit 10e0cbaaf1 )
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com >
2023-01-30 15:48:25 -05:00
John Harrison
5bc4b43d5c
drm/i915: Fix up locking around dumping requests lists
...
The debugfs dump of requests was confused about what state requires
the execlist lock versus the GuC lock. There was also a bunch of
duplicated messy code between it and the error capture code.
So refactor the hung request search into a re-usable function. And
reduce the span of the execlist state lock to only the execlist
specific code paths. In order to do that, also move the report of hold
count (which is an execlist only concept) from the top level dump
function to the lower level execlist specific function. Also, move the
execlist specific code into the execlist source file.
v2: Rename some functions and move to more appropriate files (Daniele).
v3: Rename new execlist dump function (Daniele)
Fixes: dc0dad365c ("drm/i915/guc: Fix for error capture after full GPU reset with GuC")
Signed-off-by: John Harrison <John.C.Harrison@Intel.com >
Reviewed-by: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com >
Acked-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com >
Cc: Matthew Brost <matthew.brost@intel.com >
Cc: Jani Nikula <jani.nikula@linux.intel.com >
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com >
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com >
Cc: Matt Roper <matthew.d.roper@intel.com >
Cc: Umesh Nerlige Ramappa <umesh.nerlige.ramappa@intel.com >
Cc: Michael Cheng <michael.cheng@intel.com >
Cc: Lucas De Marchi <lucas.demarchi@intel.com >
Cc: Bruce Chang <yu.bruce.chang@intel.com >
Cc: Alan Previn <alan.previn.teres.alexis@intel.com >
Cc: Matthew Auld <matthew.auld@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20230127002842.3169194-4-John.C.Harrison@Intel.com
(cherry picked from commit a4be3dca53 )
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com >
2023-01-30 15:48:21 -05:00
John Harrison
86d8ddc741
drm/i915: Fix request ref counting during error capture & debugfs dump
...
When GuC support was added to error capture, the reference counting
around the request object was broken. Fix it up.
The context based search manages the spinlocking around the search
internally. So it needs to grab the reference count internally as
well. The execlist only request based search relies on external
locking, so it needs an external reference count but within the
spinlock not outside it.
The only other caller of the context based search is the code for
dumping engine state to debugfs. That code wasn't previously getting
an explicit reference at all as it does everything while holding the
execlist specific spinlock. So, that needs updaing as well as that
spinlock doesn't help when using GuC submission. Rather than trying to
conditionally get/put depending on submission model, just change it to
always do the get/put.
v2: Explicitly document adding an extra blank line in some dense code
(Andy Shevchenko). Fix multiple potential null pointer derefs in case
of no request found (some spotted by Tvrtko, but there was more!).
Also fix a leaked request in case of !started and another in
__guc_reset_context now that intel_context_find_active_request is
actually reference counting the returned request.
v3: Add a _get suffix to intel_context_find_active_request now that it
grabs a reference (Daniele).
v4: Split the intel_guc_find_hung_context change to a separate patch
and rename intel_context_find_active_request_get to
intel_context_get_active_request (Tvrtko).
v5: s/locking/reference counting/ in commit message (Tvrtko)
Fixes: dc0dad365c ("drm/i915/guc: Fix for error capture after full GPU reset with GuC")
Fixes: 573ba126ae ("drm/i915/guc: Capture error state on context reset")
Signed-off-by: John Harrison <John.C.Harrison@Intel.com >
Reviewed-by: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com >
Acked-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com >
Cc: Matthew Brost <matthew.brost@intel.com >
Cc: Jani Nikula <jani.nikula@linux.intel.com >
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com >
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com >
Cc: Andrzej Hajda <andrzej.hajda@intel.com >
Cc: Matthew Auld <matthew.auld@intel.com >
Cc: Matt Roper <matthew.d.roper@intel.com >
Cc: Umesh Nerlige Ramappa <umesh.nerlige.ramappa@intel.com >
Cc: Michael Cheng <michael.cheng@intel.com >
Cc: Lucas De Marchi <lucas.demarchi@intel.com >
Cc: Tejas Upadhyay <tejaskumarx.surendrakumar.upadhyay@intel.com >
Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com >
Cc: Aravind Iddamsetty <aravind.iddamsetty@intel.com >
Cc: Alan Previn <alan.previn.teres.alexis@intel.com >
Cc: Bruce Chang <yu.bruce.chang@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20230127002842.3169194-3-John.C.Harrison@Intel.com
(cherry picked from commit 3700e35378 )
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com >
2023-01-30 15:48:17 -05:00
John Harrison
87b04e53da
drm/i915/guc: Fix locking when searching for a hung request
...
intel_guc_find_hung_context() was not acquiring the correct spinlock
before searching the request list. So fix that up. While at it, add
some extra whitespace padding for readability.
Fixes: dc0dad365c ("drm/i915/guc: Fix for error capture after full GPU reset with GuC")
Signed-off-by: John Harrison <John.C.Harrison@Intel.com >
Reviewed-by: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com >
Acked-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com >
Cc: Matthew Brost <matthew.brost@intel.com >
Cc: Jani Nikula <jani.nikula@linux.intel.com >
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com >
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com >
Cc: Matt Roper <matthew.d.roper@intel.com >
Cc: Umesh Nerlige Ramappa <umesh.nerlige.ramappa@intel.com >
Cc: Michael Cheng <michael.cheng@intel.com >
Cc: Lucas De Marchi <lucas.demarchi@intel.com >
Cc: Tejas Upadhyay <tejaskumarx.surendrakumar.upadhyay@intel.com >
Cc: Chris Wilson <chris.p.wilson@intel.com >
Cc: Bruce Chang <yu.bruce.chang@intel.com >
Cc: Alan Previn <alan.previn.teres.alexis@intel.com >
Cc: Matthew Auld <matthew.auld@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20230127002842.3169194-2-John.C.Harrison@Intel.com
(cherry picked from commit d1c3717501 )
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com >
2023-01-30 15:48:12 -05:00
Rob Clark
41d419382e
drm/i915: Avoid potential vm use-after-free
...
Adding the vm to the vm_xa table makes it visible to userspace, which
could try to race with us to close the vm. So we need to take our extra
reference before putting it in the table.
Signed-off-by: Rob Clark <robdclark@chromium.org >
Reviewed-by: Matthew Auld <matthew.auld@intel.com >
Fixes: 9ec8795e7d ("drm/i915: Drop __rcu from gem_context->vm")
Cc: <stable@vger.kernel.org > # v5.16+
Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20230119173321.2825472-1-robdclark@gmail.com
(cherry picked from commit 99343c46d4 )
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com >
2023-01-30 15:48:08 -05:00