Vinod Govindapillai
6d181a288e
drm/i915/xe2lpd: update the dsc feature capability
...
Update the global dsc flag based on the display capabilities
reported.
v1: define the field values instead of the magic number (JaniN)
Bspec: 71161
Signed-off-by: Vinod Govindapillai <vinod.govindapillai@intel.com >
Reviewed-by: Jouni Högander <jouni.hogander@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20231001113155.80659-3-vinod.govindapillai@intel.com
Signed-off-by: Jouni Högander <jouni.hogander@intel.com >
2023-10-11 13:54:58 +03:00
Vinod Govindapillai
9a3acd8c77
drm/i915/xe2lpd: display capability register definitions
...
Register definitions to track the reported scalable display
feature configurations
Bspec: 71161
Signed-off-by: Vinod Govindapillai <vinod.govindapillai@intel.com >
Reviewed-by: Jouni Högander <jouni.hogander@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20231001113155.80659-2-vinod.govindapillai@intel.com
Signed-off-by: Jouni Högander <jouni.hogander@intel.com >
2023-10-11 13:54:34 +03:00
Bjorn Andersson
fc93835bb0
drm: Add HPD state to drm_connector_oob_hotplug_event()
...
In some implementations, such as the Qualcomm platforms, the display
driver has no way to query the current HPD state and as such it's
impossible to distinguish between disconnect and attention events.
Add a parameter to drm_connector_oob_hotplug_event() to pass the HPD
state.
Also push the test for unchanged state in the displayport altmode driver
into the i915 driver, to allow other drivers to act upon each update.
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org >
Reviewed-by: Hans de Goede <hdegoede@redhat.com >
Acked-by: Heikki Krogerus <heikki.krogerus@linux.intel.com >
Link: https://lore.kernel.org/r/20231009174048.2695981-2-dmitry.baryshkov@linaro.org
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org >
Link: https://patchwork.freedesktop.org/patch/msgid/20231009174048.2695981-2-dmitry.baryshkov@linaro.org
2023-10-11 13:20:22 +03:00
Chaitanya Kumar Borah
55ce2c37cf
drm/i915: Add wrapper for getting display step
...
Add a wrapper around intel_step_name that takes in driver data as an
argument. This wrapper will help maintain compatibility with the
proposed xe driver.
Signed-off-by: Chaitanya Kumar Borah <chaitanya.kumar.borah@intel.com >
Signed-off-by: Animesh Manna <animesh.manna@intel.com >
Reviewed-by: Uma Shankar <uma.shankar@intel.com >
Signed-off-by: Uma Shankar <uma.shankar@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20231003065211.1052385-1-chaitanya.kumar.borah@intel.com
2023-10-11 15:19:48 +05:30
Thomas Zimmermann
57390019b6
Merge drm/drm-next into drm-misc-next
...
Updating drm-misc-next to the state of Linux v6.6-rc2.
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de >
2023-10-11 09:50:59 +02:00
John Harrison
039adf3947
drm/i915: More use of GT specific print helpers
...
Update a bunch of GT related print messages in non-GT files to use the
GT specific helpers.
Signed-off-by: John Harrison <John.C.Harrison@Intel.com >
Reviewed-by: Andi Shyti <andi.shyti@linux.intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20231009183802.673882-3-John.C.Harrison@Intel.com
2023-10-10 15:40:26 -07:00
John Harrison
e96aef0793
drm/i915/gt: More use of GT specific print helpers
...
A bunch of print messages got missed in the update to using sub-system
specific helpers. So update those.
Signed-off-by: John Harrison <John.C.Harrison@Intel.com >
Reviewed-by: Andi Shyti <andi.shyti@linux.intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20231009183802.673882-2-John.C.Harrison@Intel.com
2023-10-10 15:40:24 -07:00
Suraj Kandpal
85c477011d
drm/i915/display: Free crtc_state in verify_crtc_state
...
Free hw_crtc_state in verify_crtc_state after we are done using
this or else it's just a resource leak.
Fixes: 2745bdda20 ("drm/i915: Stop clobbering old crtc state during state check")
Signed-off-by: Suraj Kandpal <suraj.kandpal@intel.com >
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com >
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20231010053208.691260-1-suraj.kandpal@intel.com
2023-10-10 21:43:57 +03:00
Ville Syrjälä
2bc823c920
drm/i915: Fix VLV color state readout
...
VLV was missed when the color.get_config() hook was added.
Remedy that.
Not really sure what the final plan here was since a bunch of
color related readout was left in intel_display.c anyway,
but that's for anothr day to figure out...
Cc: Jani Nikula <jani.nikula@intel.com >
Fixes: 9af09dfcdf ("drm/i915/color: move pre-SKL gamma and CSC enable read to intel_color")
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20231009145828.12960-1-ville.syrjala@linux.intel.com
Reviewed-by: Jani Nikula <jani.nikula@intel.com >
2023-10-10 10:41:41 +03:00
Daniele Ceraolo Spurio
ca1e2a8339
drm/i915/guc: Enable WA 14018913170
...
The GuC handles the WA, the KMD just needs to set the flag to enable
it on the appropriate platforms.
Signed-off-by: John Harrison <John.C.Harrison@Intel.com >
Signed-off-by: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com >
Reviewed-by: Vinay Belgaumkar <vinay.belgaumkar@intel.com >
Reviewed-by: Andi Shyti <andi.shyti@linux.intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20231006013553.1339418-1-John.C.Harrison@Intel.com
2023-10-09 16:35:04 -07:00
Kees Cook
3e78f77121
drm/i915/guc: Annotate struct ct_incoming_msg with __counted_by
...
Prepare for the coming implementation by GCC and Clang of the __counted_by
attribute. Flexible array members annotated with __counted_by can have
their accesses bounds-checked at run-time via CONFIG_UBSAN_BOUNDS (for
array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family
functions).
As found with Coccinelle[1], add __counted_by for struct ct_incoming_msg.
Cc: Jani Nikula <jani.nikula@linux.intel.com >
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com >
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com >
Cc: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com >
Cc: David Airlie <airlied@gmail.com >
Cc: Daniel Vetter <daniel@ffwll.ch >
Cc: "Gustavo A. R. Silva" <gustavoars@kernel.org >
Cc: John Harrison <John.C.Harrison@Intel.com >
Cc: Matthew Brost <matthew.brost@intel.com >
Cc: Michal Wajdeczko <michal.wajdeczko@intel.com >
Cc: Matt Roper <matthew.d.roper@intel.com >
Cc: intel-gfx@lists.freedesktop.org
Cc: dri-devel@lists.freedesktop.org
Cc: linux-hardening@vger.kernel.org
Link: https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci [1]
Signed-off-by: Kees Cook <keescook@chromium.org >
Reviewed-by: Gustavo A. R. Silva <gustavoars@kernel.org >
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/20231006201744.work.135-kees@kernel.org
2023-10-09 13:59:18 +02:00
John Harrison
1621a8edc2
drm/i915/guc: Update 'recommended' version to 70.12.1 for DG2/ADL-S/ADL-P/MTL
...
The latest GuC has new features and new workarounds that we wish to
enable. So let the universe know that it is useful to update their
firmware.
Signed-off-by: John Harrison <John.C.Harrison@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/20231006145801.161868-1-John.C.Harrison@Intel.com
2023-10-07 23:06:48 +02:00
Suraj Kandpal
3385375be6
drm/i915/ddi: Remove redundant intel_connector NULL check
...
Remove redundant intel_connector NULL check. Having it here just
creates further confusion and also the variable already gets
dereferenced before the aforementioned NULL check
Signed-off-by: Suraj Kandpal <suraj.kandpal@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/20231006072830.581487-1-suraj.kandpal@intel.com
2023-10-07 08:08:49 +02:00
Ville Syrjälä
ae2b1c380e
drm/i915: s/dev_priv/i915/ in the state checker
...
Switch the state checker over to using the new 'i915' variable
name insteda of the old 'dev_priv'.
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20231004155607.7719-13-ville.syrjala@linux.intel.com
Reviewed-by: Jani Nikula <jani.nikula@intel.com >
2023-10-07 00:12:46 +03:00
Ville Syrjälä
3ce6ac8c5e
drm/i915: s/pipe_config/crtc_state/ in the state checker
...
Switch over to the modern variable naming in the state checker.
Ie. rename the pipe_config stuff to crtc_state.
Also make it clear which is the "software state" (ie. what the
current state should be) vs. "hardware state" (ie. what the
currnet state really is).
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20231004155607.7719-12-ville.syrjala@linux.intel.com
Reviewed-by: Jani Nikula <jani.nikula@intel.com >
2023-10-07 00:12:46 +03:00
Ville Syrjälä
4627bef626
drm/i915: Simplify the state checker calling convetions
...
We're passing in a totally random mismash of things into the state
checker. Clean it up to pass in the minimum needed.
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20231004155607.7719-11-ville.syrjala@linux.intel.com
Reviewed-by: Jani Nikula <jani.nikula@intel.com >
2023-10-07 00:12:46 +03:00
Ville Syrjälä
a4e71126ac
drm/i915: Constify remainder of the state checker
...
Mark the remaining crtc states used by the state checker as const.
There is no reason to ever mutate them here.
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20231004155607.7719-10-ville.syrjala@linux.intel.com
Reviewed-by: Jani Nikula <jani.nikula@intel.com >
2023-10-07 00:12:46 +03:00
Ville Syrjälä
335aa752cf
drm/i915: Simplify snps/c10x DPLL state checker calling convetion
...
Passing in the atomic state + crtc state is a bit weird. The latter
can be just the crtc (which is the normal calling convention used
in a lot of other places).
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20231004155607.7719-9-ville.syrjala@linux.intel.com
Reviewed-by: Jani Nikula <jani.nikula@intel.com >
2023-10-07 00:12:46 +03:00
Ville Syrjälä
c788479a7c
drm/i915: Constify the snps/c10x PLL state checkers
...
State checkers should never modify the crtc states, so make
them const.
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20231004155607.7719-8-ville.syrjala@linux.intel.com
Reviewed-by: Jani Nikula <jani.nikula@intel.com >
2023-10-07 00:12:46 +03:00
Ville Syrjälä
8f0994d47e
drm/i915: Simplify watermark state checker calling convention
...
There is never any reason to pass in both the crtc and its state
as one can always dig out the crtc from its state. But for more
consistency across the whole state checker let's just pass the
overall atomic state+crtc here as well.
v2: Also pass state+crtc here (Jani)
Reviewed-by: Jani Nikula <jani.nikula@intel.com >
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20231005122713.3531-1-ville.syrjala@linux.intel.com
2023-10-07 00:12:46 +03:00
Ville Syrjälä
487a2db8bc
drm/i915: Constify watermark state checker
...
The skl+ wm state checker has no reason to modify the crtc state,
so make it const.
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20231004155607.7719-6-ville.syrjala@linux.intel.com
Reviewed-by: Jani Nikula <jani.nikula@intel.com >
2023-10-07 00:12:42 +03:00
Ville Syrjälä
4d6e198a3a
drm/i915: Simplify DPLL state checker calling convention
...
Make life simpler by just passing in the atomic state + crtc
instead of plumbing in all kinds of crtc states.
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20231004155607.7719-5-ville.syrjala@linux.intel.com
Reviewed-by: Jani Nikula <jani.nikula@intel.com >
2023-10-06 23:59:20 +03:00
Ville Syrjälä
cfc7109bf6
drm/i915: Constify the crtc states in the DPLL checker
...
The DPLL state checker should not be modifying the crtc states,
so make the const.
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20231004155607.7719-4-ville.syrjala@linux.intel.com
Reviewed-by: Jani Nikula <jani.nikula@intel.com >
2023-10-06 23:59:00 +03:00
Ville Syrjälä
2745bdda20
drm/i915: Stop clobbering old crtc state during state check
...
The state checker overwrites the old crtc state with the
current hardware state. While that does save a kmalloc() it seems
rather dubious as there might still be something that we need
in the old crtc state.
Stop doing that and just allocate a temporary state for the state
checker. Should the extra malloc during the commit phase turn out
too annoying we could of course preallocate one for each crtc, but
let's proceed with the straightforward approch for now.
And while at it let's mark the new crtc state as const to make
sure the state checker doesn't mess it up.
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20231004155607.7719-3-ville.syrjala@linux.intel.com
Reviewed-by: Jani Nikula <jani.nikula@intel.com >
2023-10-06 23:58:33 +03:00
Ville Syrjälä
12e03c8058
drm/i915/psr: Unify PSR pre/post plane update hooks
...
intel_psr_pre_plane_update() operates on a per-crtc level, whereas
intel_psr_post_plane_update() operates on the whole atomic commit,
for no real reason that I can see. Adjust intel_psr_post_plane_update()
to match the intel_psr_pre_plane_update() approach.
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20231004155607.7719-2-ville.syrjala@linux.intel.com
Reviewed-by: Jani Nikula <jani.nikula@intel.com >
2023-10-06 23:58:16 +03:00
Jani Nikula
e2272bfb18
drm/dp: switch drm_dp_downstream_*() helpers to struct drm_edid
...
Prefer struct drm_edid where possible. With limited users for the
drm_dp_downstream_*() helpers, this is fairly straightforward.
Signed-off-by: Jani Nikula <jani.nikula@intel.com >
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20231004162149.2802113-1-jani.nikula@intel.com
2023-10-05 16:19:09 +03:00
Ville Syrjälä
64909aa6dd
drm/i915/fbc: Remove pointless "stride is multiple of 64 bytes" check
...
Plane stride is always a multiple of 64 bytes. Remove the
pointless check that really doesn't have anything to do
with FBC.
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20231003194256.28569-6-ville.syrjala@linux.intel.com
Reviewed-by: Vinod Govindapillai <vinod.govindapillai@intel.com >
2023-10-05 13:25:36 +03:00
Ville Syrjälä
1fe5c43e44
drm/i915/fbc: Split plane pixel format checks per-platform
...
Carve up pixel_format_is_valid() into per-platform variants to
make it easier to see what limits are actually being imposed.
Note that the XRGB1555 can be dropped from the g4x+ variant
since the plane no longer supports that format anyway.
TODO: maybe go for vfuncs later
v2: Update for lnl changes
Reviewed-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com > #v1
Reviewed-by: Vinod Govindapillai <vinod.govindapillai@intel.com >
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20231003194256.28569-5-ville.syrjala@linux.intel.com
2023-10-05 13:25:36 +03:00
Ville Syrjälä
5737f7dc16
drm/i915/fbc: Split plane rotation checks per-platform
...
Carve up rotation_is_valid() into per-platform variants to
make it easier to see what limits are actually being imposed.
TODO: maybe go for vfuncs later
Reviewed-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com >
Reviewed-by: Vinod Govindapillai <vinod.govindapillai@intel.com >
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20231003194256.28569-4-ville.syrjala@linux.intel.com
2023-10-05 13:25:36 +03:00
Ville Syrjälä
9fbe915b88
drm/i915/fbc: Split plane tiling checks per-platform
...
Carve up tiling_is_valid() into per-platform variants to
make it easier to see what limits are actually being imposed.
TODO: maybe go for vfuncs later
Reviewed-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com >
Reviewed-by: Vinod Govindapillai <vinod.govindapillai@intel.com >
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20231003194256.28569-3-ville.syrjala@linux.intel.com
2023-10-05 13:25:36 +03:00
Ville Syrjälä
a8a3b4cd74
drm/i915/fbc: Split plane stride checks per-platform
...
Carve up stride_is_valid() into per-platform variants to
make it easier to see what limits are actually being imposed.
TODO: maybe go for vfuncs later
Reviewed-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com >
Reviewed-by: Vinod Govindapillai <vinod.govindapillai@intel.com >
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20231003194256.28569-2-ville.syrjala@linux.intel.com
2023-10-05 13:25:36 +03:00
Ville Syrjälä
da7b3b03f4
drm/i915/fbc: Remove ancient 16k plane stride limit
...
The 16k max plane stride limit seems to be originally from
i965gm, and no explicit limit has been specified since (g4x+).
So let's assume the max plane stride itself is a suitable limit
also for the more recent FBC hardware.
In fact even for i965gm the max X-tiled stride is also 16k so
technically we don't need the check there either, but let's
keep it there anyway since it's explicitly mentioned in the
spec. Gen2/3 have more strict limits checked separately.
Reviewed-by: Swati Sharma <swati2.sharma@intel.com >
Reviewed-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com >
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20231003194256.28569-1-ville.syrjala@linux.intel.com
2023-10-05 13:25:36 +03:00
Uros Bizjak
6097cdac5a
drm/i915/pmu: Use local64_try_cmpxchg in i915_pmu_event_read
...
Use local64_try_cmpxchg instead of local64_cmpxchg (*ptr, old, new) == old
in i915_pmu_event_read. x86 CMPXCHG instruction returns success in ZF flag,
so this change saves a compare after cmpxchg (and related move instruction
in front of cmpxchg).
Also, try_cmpxchg implicitly assigns old *ptr value to "old" when cmpxchg
fails. There is no need to re-read the value in the loop.
No functional change intended.
Cc: Jani Nikula <jani.nikula@linux.intel.com >
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com >
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com >
Cc: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com >
Cc: David Airlie <airlied@gmail.com >
Cc: Daniel Vetter <daniel@ffwll.ch >
Signed-off-by: Uros Bizjak <ubizjak@gmail.com >
Reviewed-by: Jani Nikula <jani.nikula@intel.com >
Signed-off-by: Jani Nikula <jani.nikula@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20230703150859.6176-1-ubizjak@gmail.com
2023-10-05 13:20:40 +03:00
Kees Cook
8a922cf12c
drm/i915/selftests: Annotate struct perf_series with __counted_by
...
Prepare for the coming implementation by GCC and Clang of the __counted_by
attribute. Flexible array members annotated with __counted_by can have
their accesses bounds-checked at run-time checking via CONFIG_UBSAN_BOUNDS
(for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family
functions).
As found with Coccinelle[1], add __counted_by for struct perf_series.
[1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci
Cc: Jani Nikula <jani.nikula@linux.intel.com >
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com >
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com >
Cc: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com >
Cc: David Airlie <airlied@gmail.com >
Cc: Daniel Vetter <daniel@ffwll.ch >
Cc: Chris Wilson <chris@chris-wilson.co.uk >
Cc: John Harrison <john.c.harrison@Intel.com >
Cc: Andi Shyti <andi.shyti@linux.intel.com >
Cc: Matthew Brost <matthew.brost@intel.com >
Cc: intel-gfx@lists.freedesktop.org
Cc: dri-devel@lists.freedesktop.org
Signed-off-by: Kees Cook <keescook@chromium.org >
Reviewed-by: Gustavo A. R. Silva <gustavoars@kernel.org >
Reviewed-by: Andrzej Hajda <andrzej.hajda@intel.com >
Reviewed-by: Andi Shyti <andi.shyti@linux.intel.com >
Signed-off-by: Christian König <christian.koenig@amd.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20230922173216.3823169-3-keescook@chromium.org
2023-10-05 11:30:40 +02:00
Uma Shankar
5846cdfd3d
drm/i915/display: Created exclusive version of vga decode setup
...
Current vga arbiter implementation in i915 needs a re-design.
The current approach would cause real problems if anyone actually
needs to talk another GPU using legacy VGA resources.
The main issue is that X becomes a slideshow if it thinks there
are multiple GPUs that have VGA decoding enabled as it insists
on adjusting the VGA routing pretty much for every little operation
involving any of the GPUs.
The cleanup will be planned for i915. Meanwhile to focus on Xe
upstreaming and have a cleaner separation, the said functionality
is being moved to a different file exclusive for i915. Xe driver
will re-use rest of the display code from i915.
v2: Addressed Jani Nikula's review comments.
v3: Dropped a duplicate function (Jani)
v4: Updated commit message with reasoning as sugested by Ville.
Signed-off-by: Uma Shankar <uma.shankar@intel.com >
Reviewed-by: Arun R Murthy <arun.r.murthy@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20230929074306.1533859-1-uma.shankar@intel.com
2023-10-05 12:37:08 +05:30
Andreas Gruenbacher
6309727ef2
kthread: add kthread_stop_put
...
Add a kthread_stop_put() helper that stops a thread and puts its task
struct. Use it to replace the various instances of kthread_stop()
followed by put_task_struct().
Remove the kthread_stop_put() macro in usbip that is similar but doesn't
return the result of kthread_stop().
[agruenba@redhat.com: fix kerneldoc comment]
Link: https://lkml.kernel.org/r/20230911111730.2565537-1-agruenba@redhat.com
[akpm@linux-foundation.org: document kthread_stop_put()'s argument]
Link: https://lkml.kernel.org/r/20230907234048.2499820-1-agruenba@redhat.com
Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com >
Signed-off-by: Andrew Morton <akpm@linux-foundation.org >
2023-10-04 10:41:57 -07:00
Qi Zheng
583cc9e410
drm/i915: dynamically allocate the i915_gem_mm shrinker
...
In preparation for implementing lockless slab shrink, use new APIs to
dynamically allocate the i915_gem_mm shrinker, so that it can be freed
asynchronously via RCU. Then it doesn't need to wait for RCU read-side
critical section when releasing the struct drm_i915_private.
Link: https://lkml.kernel.org/r/20230911094444.68966-21-zhengqi.arch@bytedance.com
Signed-off-by: Qi Zheng <zhengqi.arch@bytedance.com >
Reviewed-by: Muchun Song <songmuchun@bytedance.com >
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch >
Cc: Jani Nikula <jani.nikula@linux.intel.com >
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com >
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com >
Cc: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com >
Cc: David Airlie <airlied@gmail.com >
Cc: Abhinav Kumar <quic_abhinavk@quicinc.com >
Cc: Alasdair Kergon <agk@redhat.com >
Cc: Alexander Viro <viro@zeniv.linux.org.uk >
Cc: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com >
Cc: Andreas Dilger <adilger.kernel@dilger.ca >
Cc: Andreas Gruenbacher <agruenba@redhat.com >
Cc: Anna Schumaker <anna@kernel.org >
Cc: Arnd Bergmann <arnd@arndb.de >
Cc: Bob Peterson <rpeterso@redhat.com >
Cc: Borislav Petkov <bp@alien8.de >
Cc: Carlos Llamas <cmllamas@google.com >
Cc: Chandan Babu R <chandan.babu@oracle.com >
Cc: Chao Yu <chao@kernel.org >
Cc: Chris Mason <clm@fb.com >
Cc: Christian Brauner <brauner@kernel.org >
Cc: Christian Koenig <christian.koenig@amd.com >
Cc: Chuck Lever <cel@kernel.org >
Cc: Coly Li <colyli@suse.de >
Cc: Dai Ngo <Dai.Ngo@oracle.com >
Cc: Daniel Vetter <daniel@ffwll.ch >
Cc: "Darrick J. Wong" <djwong@kernel.org >
Cc: Dave Chinner <david@fromorbit.com >
Cc: Dave Hansen <dave.hansen@linux.intel.com >
Cc: David Hildenbrand <david@redhat.com >
Cc: David Sterba <dsterba@suse.com >
Cc: Dmitry Baryshkov <dmitry.baryshkov@linaro.org >
Cc: Gao Xiang <hsiangkao@linux.alibaba.com >
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
Cc: Huang Rui <ray.huang@amd.com >
Cc: Ingo Molnar <mingo@redhat.com >
Cc: Jaegeuk Kim <jaegeuk@kernel.org >
Cc: Jan Kara <jack@suse.cz >
Cc: Jason Wang <jasowang@redhat.com >
Cc: Jeff Layton <jlayton@kernel.org >
Cc: Jeffle Xu <jefflexu@linux.alibaba.com >
Cc: Joel Fernandes (Google) <joel@joelfernandes.org >
Cc: Josef Bacik <josef@toxicpanda.com >
Cc: Juergen Gross <jgross@suse.com >
Cc: Kent Overstreet <kent.overstreet@gmail.com >
Cc: Kirill Tkhai <tkhai@ya.ru >
Cc: Marijn Suijten <marijn.suijten@somainline.org >
Cc: "Michael S. Tsirkin" <mst@redhat.com >
Cc: Mike Snitzer <snitzer@kernel.org >
Cc: Minchan Kim <minchan@kernel.org >
Cc: Muchun Song <muchun.song@linux.dev >
Cc: Nadav Amit <namit@vmware.com >
Cc: Neil Brown <neilb@suse.de >
Cc: Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com >
Cc: Olga Kornievskaia <kolga@netapp.com >
Cc: Paul E. McKenney <paulmck@kernel.org >
Cc: Richard Weinberger <richard@nod.at >
Cc: Rob Clark <robdclark@gmail.com >
Cc: Rob Herring <robh@kernel.org >
Cc: Roman Gushchin <roman.gushchin@linux.dev >
Cc: Sean Paul <sean@poorly.run >
Cc: Sergey Senozhatsky <senozhatsky@chromium.org >
Cc: Song Liu <song@kernel.org >
Cc: Stefano Stabellini <sstabellini@kernel.org >
Cc: Steven Price <steven.price@arm.com >
Cc: "Theodore Ts'o" <tytso@mit.edu >
Cc: Thomas Gleixner <tglx@linutronix.de >
Cc: Tomeu Vizoso <tomeu.vizoso@collabora.com >
Cc: Tom Talpey <tom@talpey.com >
Cc: Trond Myklebust <trond.myklebust@hammerspace.com >
Cc: Vlastimil Babka <vbabka@suse.cz >
Cc: Xuan Zhuo <xuanzhuo@linux.alibaba.com >
Cc: Yue Hu <huyue2@coolpad.com >
Signed-off-by: Andrew Morton <akpm@linux-foundation.org >
2023-10-04 10:32:24 -07:00
Imre Deak
07f9cfe2ef
drm/i915/dp_mst: Make sure pbn_div is up-to-date after sink reconnect
...
Atm the MST encoder config computation may use an out-of-date pbn_div
value, if the sink is unplugged and a sink is replugged with different
link rate/lane count capabilities. The current way of reinitializing
pbn_div depends on pbn_div getting cleared via intel_atomic_check() ->
drm_dp_mst_atomic_check() ->
drm_dp_mst_atomic_check_payload_alloc_limits(), however the clearing
won't happen if the sink got unplugged (and hence
drm_dp_mst_topology_mgr::mst_state being false).
To fix the above, simply update pbn_div unconditionally during config
computation, making pbn_div always match the link rate and lane count.
Cc: Lyude Paul <lyude@redhat.com >
Reviewed-by: Lyude Paul <lyude@redhat.com >
Signed-off-by: Imre Deak <imre.deak@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20230929154929.343947-1-imre.deak@intel.com
2023-10-04 18:48:31 +03:00
Niko Tsirakis
cf37c0979e
drm/i915/display/lspcon: Increase LSPCON mode settle timeout
...
This is to eliminate all cases of "*ERROR* LSPCON mode hasn't settled",
followed by link training errors. Intel engineers recommended increasing
this timeout and that does resolve the issue.
On some CometLake-based device designs the Parade PS175 takes more than
400ms to settle in PCON mode. 100 reboot trials on one device resulted
in a median settle time of 440ms and a maximum of 444ms. Even after
increasing the timeout to 500ms, 2% of devices still had this error. So
this increases the timeout to 800ms.
Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/9443
Signed-off-by: Pablo Ceballos <pceballos@google.com >
Signed-off-by: Niko Tsirakis <ntsirakis@google.com >
Reviewed-by: Jani Nikula <jani.nikula@intel.com >
Signed-off-by: Jani Nikula <jani.nikula@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20231002204709.761089-1-ntsirakis@google.com
2023-10-04 18:34:20 +03:00
Jani Nikula
14aebb78b9
drm/i915/gt: remove i915->gt0 in favour of i915->gt[0]
...
Since gt0 == i915->gt[0], just drop the former.
Signed-off-by: Jani Nikula <jani.nikula@intel.com >
Reviewed-by: Gustavo Sousa <gustavo.sousa@intel.com >
Reviewed-by: Andi Shyti <andi.shyti@linux.intel.com >
Acked-by: Michał Winiarski <michal.winiarski@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/5319364f4c9416fed218382d020a57c5b0a17bee.1696236329.git.jani.nikula@intel.com
2023-10-04 18:27:51 +03:00
Jani Nikula
39fa9a7d5f
drm/i915: allocate i915->gt0 dynamically
...
Convert i915->gt0 to a pointer, and allocate it dynamically.
Signed-off-by: Jani Nikula <jani.nikula@intel.com >
Reviewed-by: Gustavo Sousa <gustavo.sousa@intel.com >
Reviewed-by: Andi Shyti <andi.shyti@linux.intel.com >
Acked-by: Michał Winiarski <michal.winiarski@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/01bf968aa431b77d491790178cbeece18b5fc4c0.1696236329.git.jani.nikula@intel.com
2023-10-04 18:27:46 +03:00
Jani Nikula
5ed8c7bcf9
drm/i915/mocs: use to_gt() instead of direct &i915->gt
...
Have to give up the const on i915 pointer, but it's not big of a deal
considering non-const i915 gets passed all over the place.
Signed-off-by: Jani Nikula <jani.nikula@intel.com >
Reviewed-by: Gustavo Sousa <gustavo.sousa@intel.com >
Reviewed-by: Andi Shyti <andi.shyti@linux.intel.com >
Acked-by: Michał Winiarski <michal.winiarski@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/63e644f056c7745eb0e8e165c990c392a38ec85c.1696236329.git.jani.nikula@intel.com
2023-10-04 18:27:33 +03:00
Jani Nikula
7824a88b42
Merge drm/drm-next into drm-intel-next
...
Backmerge to sync up with drm-intel-gt-next and drm-misc-next.
Signed-off-by: Jani Nikula <jani.nikula@intel.com >
2023-10-04 18:06:27 +03:00
Ville Syrjälä
25591b66d0
drm/i915: s/dev_priv/i915/ in the shared_dpll code
...
Do a s/dev_priv/i915/ pass over the shared_dpll code to
get the variable names into sync with modern standards.
v2: Rebase
Reviewed-by: Jani Nikula <jani.nikula@intel.com > #v1
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20231003200620.11633-5-ville.syrjala@linux.intel.com
2023-10-04 16:49:50 +03:00
Ville Syrjälä
51d3e62927
drm/i915: Introduce for_each_shared_dpll()
...
No one really cares how we store the shared_dplls. Currently
it happens to be an array, but we could change that to a more
flexible scheme at some point. Hide the implementation details
behind an iterator macro.
The slight downside is the pll variable moving out of the
loop scope, but maybe someday soon we'll start to convert
everything over to having declarations within for-statements...
Reviewed-by: Jani Nikula <jani.nikula@intel.com >
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20231003200620.11633-4-ville.syrjala@linux.intel.com
2023-10-04 16:46:45 +03:00
Ville Syrjälä
99e5a010e8
drm/i915: Decouple I915_NUM_PLLS from PLL IDs
...
Stop assuming the size of PLL ID based bitmask is restricted
to I915_NUM_PLLS bits. This is the last thing coupling the
two things together and thus artificially limiting PLL IDs.
We could just pass any arbitrary (large enough) size to
for_each_set_bit() and be done with it, but the WARN
requiring the caller to not pass in a bogus bitmask seems
potentially useful to keep around. So let's just calculate
the full bitmask on the spot.
And while at it let's assert that the PLL IDs will fit
into the bitmask we use for them.
TODO: could also get rid of I915_NUM_PLLS entirely and just
dynamically allocate i915->shared_dplls[] and state->shared_dpll[].
But that would involve error handling in the modeset init path. Uff.
v2: Warn about conflicting PLL IDs (Jani)
Reviewed-by: Jani Nikula <jani.nikula@intel.com >
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20231003200620.11633-3-ville.syrjala@linux.intel.com
2023-10-04 16:46:36 +03:00
Ville Syrjälä
027c570177
drm/i915: Stop requiring PLL index == PLL ID
...
There's no good reason to keep around this PLL index == PLL ID
footgun. Get rid of it.
Both i915->shared_dplls[] and state->shared_dpll[] are indexed
by the same thing now, which is just the index we get at
initialization from dpll_mgr->dpll_info[]. The rest is all about
PLL IDs now.
v2: Add pll->index to mimic drm_crtc & co.
Remove the comment saying ID should match the index
v3: s/i/pll->index/ in debugfs loop (Jani)
Reviewed-by: Jani Nikula <jani.nikula@intel.com >
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20231003200620.11633-2-ville.syrjala@linux.intel.com
2023-10-04 16:46:25 +03:00
Chris Wilson
1fbb6c1d88
drm/i915: Invalidate the TLBs on each GT
...
With multi-GT devices, the object may have been bound on each GT and so
we need to invalidate the TLBs across all GT before releasing the pages
back to the system.
Fixes: d6c531ab48 ("drm/i915: Invalidate the TLBs on each GT")
Signed-off-by: Chris Wilson <chris.p.wilson@intel.com >
Signed-off-by: Jonathan Cavitt <jonathan.cavitt@intel.com >
CC: Matt Roper <matthew.d.roper@intel.com >
CC: Andi Shyti <andi.shyti@linux.intel.com >
Reviewed-by: Andi Shyti <andi.shyti@linux.intel.com >
Reviewed-by: Nirmoy Das <nirmoy.das@intel.com >
Signed-off-by: Andi Shyti <andi.shyti@linux.intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20231002140742.933530-1-jonathan.cavitt@intel.com
(cherry picked from commit 6b8ace7a14 )
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com >
2023-10-04 09:00:37 -04:00
Mathias Krause
6007265ad7
drm/i915: Register engines early to avoid type confusion
...
Commit 1ec23ed712 ("drm/i915: Use uabi engines for the default engine
map") switched from using for_each_engine() to for_each_uabi_engine() to
iterate over the user engines. While this seems to be a sensible change,
it's only safe to do when the engines are actually chained using the
rb-tree structure which is not the case during early driver
initialization where it can be either a lock-less list or regular
double-linked list.
In fact, the modesetting initialization code may end up calling
default_engines() through the fb helper code while the engines list
is still llist_node-based:
i915_driver_probe() ->
intel_display_driver_probe() ->
intel_fbdev_init() ->
drm_fb_helper_init() ->
drm_client_init() ->
drm_client_open() ->
drm_file_alloc() ->
i915_driver_open() ->
i915_gem_open() ->
i915_gem_context_open() ->
i915_gem_create_context() ->
default_engines()
Using for_each_uabi_engine() in default_engines() is therefore wrong, as
it would try to interpret the llist as rb-tree, making it find no engine
at all, as the rb_left and rb_right members will still be NULL, as they
haven't been initialized yet.
To fix this type confusion register the engines earlier and at the same
time reduce the amount of code that has to deal with the intermediate
llist state.
Reported-by: sanity checks in grsecurity
Suggested-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com >
Fixes: 1ec23ed712 ("drm/i915: Use uabi engines for the default engine map")
Signed-off-by: Mathias Krause <minipli@grsecurity.net >
Cc: Jonathan Cavitt <jonathan.cavitt@intel.com >
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com >
Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com >
Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20230928182019.10256-2-minipli@grsecurity.net
[tursulin: fixed commit tag typo]
(cherry picked from commit 2b562f032f )
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com >
2023-10-04 09:00:34 -04:00
Nirmoy Das
128c20eda7
drm/i915: Don't set PIPE_CONTROL_FLUSH_L3 for aux inval
...
PIPE_CONTROL_FLUSH_L3 is not needed for aux invalidation
so don't set that.
Fixes: 78a6ccd65f ("drm/i915/gt: Ensure memory quiesced before invalidation")
Cc: Jonathan Cavitt <jonathan.cavitt@intel.com >
Cc: Andi Shyti <andi.shyti@linux.intel.com >
Cc: <stable@vger.kernel.org > # v5.8+
Cc: Andrzej Hajda <andrzej.hajda@intel.com >
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com >
Cc: Matt Roper <matthew.d.roper@intel.com >
Cc: Tejas Upadhyay <tejas.upadhyay@intel.com >
Cc: Lucas De Marchi <lucas.demarchi@intel.com >
Cc: Prathap Kumar Valsan <prathap.kumar.valsan@intel.com >
Cc: Tapani Pälli <tapani.palli@intel.com >
Cc: Mark Janes <mark.janes@intel.com >
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com >
Signed-off-by: Nirmoy Das <nirmoy.das@intel.com >
Acked-by: Matt Roper <matthew.d.roper@intel.com >
Reviewed-by: Andi Shyti <andi.shyti@linux.intel.com >
Tested-by: Tapani Pälli <tapani.palli@intel.com >
Reviewed-by: Andrzej Hajda <andrzej.hajda@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20230926142401.25687-1-nirmoy.das@intel.com
(cherry picked from commit 03d681412b )
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com >
2023-10-04 09:00:29 -04:00