Nirmoy Das
5dffaa1bb9
drm/xe: Create a helper function to init job's user fence
...
Refactor xe_sync_entry_signal so it doesn't have to
modify xe_sched_job struct instead create a new helper function
to set user fence values for a job.
v2: Move the sync type check to xe_sched_job_init_user_fence(Lucas)
Cc: Lucas De Marchi <lucas.demarchi@intel.com >
Cc: Matthew Auld <matthew.auld@intel.com >
Cc: Matthew Brost <matthew.brost@intel.com >
Cc: Michal Wajdeczko <michal.wajdeczko@intel.com >
Signed-off-by: Nirmoy Das <nirmoy.das@intel.com >
Reviewed-by: Lucas De Marchi <lucas.demarchi@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20240321161142.4954-1-nirmoy.das@intel.com
Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com >
2024-03-26 15:40:19 -07:00
Vinay Belgaumkar
4b217c7fa6
drm/xe/guc: Remove explicit shutdown of SLPC
...
SLPC shutdown is called in reset and suspend paths. In the reset
path, it is possible that the H2G call gets lost as GuC is in the
process of being reset. There is no value in stopping SLPC when
it will happen anyways.
In the suspend path, we disable communication with GuC, so there
is no need to explicitly shutdown SLPC.
v2: Rebase
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com >
Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com >
Signed-off-by: Vinay Belgaumkar <vinay.belgaumkar@intel.com >
Signed-off-by: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20240325235602.1155486-1-vinay.belgaumkar@intel.com
2024-03-26 15:35:38 -07:00
Ravi Kumar Vodapalli
0bd25f78c4
drm/xe: Add new PCI IDs to DG2 platform
...
New PCI IDs are added in Bspec for DG2 platform, add them in driver
Bspec: 44477
Signed-off-by: Ravi Kumar Vodapalli <ravi.kumar.vodapalli@intel.com >
Reviewed-by: Matt Roper <matthew.d.roper@intel.com >
Signed-off-by: Matt Roper <matthew.d.roper@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20240326103825.3832879-1-ravi.kumar.vodapalli@intel.com
2024-03-26 13:58:20 -07:00
Niranjana Vishwanathapura
cf03825bdd
drm/xe: Use FIELD_PREP for lrc descriptor
...
Use FIELD_PREP for setting lrc descriptor fields instead
of shifting values to fields.
v2: Use ULL macro variants
v3: Do not use FIELD_PREP for 1-bit values
Signed-off-by: Niranjana Vishwanathapura <niranjana.vishwanathapura@intel.com >
Reviewed-by: Lucas De Marchi <lucas.demarchi@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20240322191455.7613-1-niranjana.vishwanathapura@intel.com
Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com >
2024-03-26 09:17:13 -07:00
Lucas De Marchi
008aa86a09
drm/xe: Remove redundant functions to get xe
...
xe_device.h implements these helpers, just use them.
Reviewed-by: Ashutosh Dixit <ashutosh.dixit@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20240321213818.72311-1-lucas.demarchi@intel.com
Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com >
2024-03-22 14:25:56 -07:00
Lucas De Marchi
35b22649eb
drm/xe: Fix END redefinition
...
mips declares an END macro in its headers so it can't be used without
namespace in a driver like xe.
Instead of coming up with a longer name, just remove the macro and
replace its use with 0 since it's still clear what that means:
set_offsets() was already using that implicitly when checking the data
variable.
Reported-by: Guenter Roeck <linux@roeck-us.net >
Closes: http://kisskb.ellerman.id.au/kisskb/buildresult/15143996/
Tested-by: Guenter Roeck <linux@roeck-us.net >
Reviewed-by: Jani Nikula <jani.nikula@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20240322145037.196548-1-lucas.demarchi@intel.com
Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com >
2024-03-22 11:27:58 -07:00
Daniele Ceraolo Spurio
b4abeb5545
drm/xe/guc: Check error code when initializing the CT mutex
...
The initialization via drmm_mutex_init can fail, so we need to check the
return code and escalate the failure.
The mutex initialization has been moved after all the other init steps
that can't fail, so we're always guaranteed to have those done and don't
have to check in the cleanup code.
Signed-off-by: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com >
Reviewed-by: Vinay Belgaumkar <vinay.belgaumkar@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20240321195512.274210-1-daniele.ceraolospurio@intel.com
2024-03-22 10:22:20 -07:00
Vinay Belgaumkar
c04b8aaeb4
drm/xe/guc: Add some failure checks
...
Return failures from pc_adjust_freq_bounds.
Signed-off-by: Vinay Belgaumkar <vinay.belgaumkar@intel.com >
Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com >
Signed-off-by: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20240321191219.243583-1-vinay.belgaumkar@intel.com
2024-03-22 10:22:08 -07:00
José Roberto de Souza
8f6444e1d1
drm/xe: Nuke EXEC_QUEUE_FLAG_PERSISTENT
...
This is a left over of commit f1a9abc0cf ("drm/xe/uapi: Remove support for persistent exec_queues").
Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com >
Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com >
Signed-off-by: José Roberto de Souza <jose.souza@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20240307135229.41973-3-jose.souza@intel.com
2024-03-22 08:08:48 -07:00
José Roberto de Souza
e5f661bb56
drm/xe/devcoredump: Print errno if VM snapshot was not captured
...
My testing machine has only 8GB of RAM and while running piglit tests
I can reach the OOM cache in xe_vm_snapshot_capture() snap allocaiton
sometimes.
So to differentiate the OOM from race between capture and UMDs
unbinbind VMs here I'm adding a '[0].error: -12' to devcoredump.
v2:
- fix returned errno values
Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com >
Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com >
Signed-off-by: José Roberto de Souza <jose.souza@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20240307135229.41973-2-jose.souza@intel.com
2024-03-22 08:08:47 -07:00
José Roberto de Souza
241dea2101
drm/xe: Make devcoredump VM error state print consistent
...
This makes VM error consistent with [x].length and [x].data.
Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com >
Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com >
Signed-off-by: José Roberto de Souza <jose.souza@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20240307135229.41973-1-jose.souza@intel.com
2024-03-22 08:08:46 -07:00
Jani Nikula
070f8fd6c6
drm/xe: remove unused struct xe_device members
...
modeset_restore_state has been unused since commit 6af0ffc0db
("drm/i915/display: move restore state and ctx under display
sub-struct").
member global_obj_list has been unused since commit e2925e19c0
("drm/i915/display: move global_obj_list under display sub-struct").
hti_state has been unused since commit 6274991254 ("drm/i915/display:
move hti under display sub-struct").
snps_phy_failed_calibration has been unused since commit 3a7e2d58f8
("drm/i915: move snps_phy_failed_calibration to display sub-struct under
snps").
Reviewed-by: José Roberto de Souza <jose.souza@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20240321161548.3509672-1-jani.nikula@intel.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com >
2024-03-22 11:32:20 +02:00
Matthew Auld
4b275f502a
drm/xe/query: fix gt_id bounds check
...
The user provided gt_id should always be less than the
XE_MAX_GT_PER_TILE.
Fixes: 7793d00d1b ("drm/xe: Correlate engine and cpu timestamps with better accuracy")
Signed-off-by: Matthew Auld <matthew.auld@intel.com >
Cc: Nirmoy Das <nirmoy.das@intel.com >
Cc: <stable@vger.kernel.org > # v6.8+
Reviewed-by: Nirmoy Das <nirmoy.das@intel.com >
Acked-by: Himal Prasad Ghimiray <himal.prasad.ghimiray@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20240321110629.334701-2-matthew.auld@intel.com
2024-03-22 08:14:03 +00:00
Matthew Brost
cdf287ce7b
drm/xe: Add debug messages for MMU notifier and VMA invalidate
...
Extra debug is useful when working on VM issues.
Signed-off-by: Matthew Brost <matthew.brost@intel.com >
Reviewed-by: Nirmoy Das <nirmoy.das@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20240320194232.1910688-1-matthew.brost@intel.com
2024-03-21 10:55:43 -07:00
Himal Prasad Ghimiray
f20b7671df
drm/xe: Use USEC_PER_MSEC rather than the hard coding
...
Use USEC_PER_MSEC rather than the hard coded value of 1000.
Static analyzer Reported "casting either timeout_ms or
1000U to type u64" to avoid overflow-before-widen.
Using USEC_PER_MSEC seems better and will help with static analyzer
report cleanup.
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com >
Signed-off-by: Himal Prasad Ghimiray <himal.prasad.ghimiray@intel.com >
Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20240320083325.3258720-1-himal.prasad.ghimiray@intel.com
Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com >
2024-03-21 06:00:54 -07:00
Matthew Auld
ee3b1e31d5
drm/xe/bb: assert width in xe_bb_create_migration_job()
...
The q->width should always be exactly one here for migration queue/vm.
The width will anyway be overridden later since we need to emit two
jumps for special migration jobs. Enforce that here to ensure caller is
not doing something strange. While here also convert to the helper to
determine if the queue is migration based.
Signed-off-by: Matthew Auld <matthew.auld@intel.com >
Cc: Nirmoy Das <nirmoy.das@intel.com >
Reviewed-by: Nirmoy Das <nirmoy.das@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20240320112730.219854-4-matthew.auld@intel.com
2024-03-21 08:29:31 +00:00
Matthew Auld
1008368e1c
drm/xe/bb: assert width in xe_bb_create_job()
...
The queue width will determine the number of batch buffer emitted into
the ring. In the case of xe_bb_create_job() we pass exactly one batch
address, therefore add an assert for the width to make sure we don't go
out of bounds. While here also convert to the helper to determine if the
queue is migration based.
Signed-off-by: Matthew Auld <matthew.auld@intel.com >
Cc: Nirmoy Das <nirmoy.das@intel.com >
Reviewed-by: Nirmoy Das <nirmoy.das@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20240320112730.219854-3-matthew.auld@intel.com
2024-03-21 08:29:30 +00:00
Daniele Ceraolo Spurio
4c15a6dcee
drm/xe/uc: Use u64 for offsets for which we use upper_32_bits()
...
The GGTT is currently a 32 bit address space, but the HW and GuC
support 48b addresses in GGTT-related operations, both to keep the
interface/HW paths common between PPGTT and GGTT and to allow for
future increase of the GGTT size.
This leaves us having to program a 64b field with a 32b offset, which
currently we're in some cases doing this by using an upper_32_bits()
call on a 32b variable, which doesn't make any sense. To do this cleanly
we have 2 options:
1 - Set the upper 32 bits directly to zero.
2 - Use 64b variables for the offset and keep programming the whole thing,
so we're ready if we ever have bigger offsets.
This patch goes with option #2 and switches the related variables to u64.
v2: don't change the log ctl flag variable (John)
Signed-off-by: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com >
Cc: John Harrison <John.C.Harrison@Intel.com >
Reviewed-by: John Harrison <John.C.Harrison@Intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20240319195101.2784480-1-daniele.ceraolospurio@intel.com
2024-03-20 14:40:57 -07:00
Daniele Ceraolo Spurio
649a125a88
drm/xe: Always check force_wake_get return code
...
A force_wake_get failure means that the HW might not be awake for the
access we're doing; this can lead to an immediate error or it can be a
more subtle problem (e.g. a register read might return an incorrect
value that is still valid, leading the driver to make a wrong choice
instead of flagging an error).
We avoid an error from the force_wake function because callers might
handle or tolerate the error, but this only works if all callers
are checking the error code. The majority already do, but a few are not.
These are mainly falling into 3 categories, which are each handled
differently:
1) error capture: in this case we want to continue the capture, but we
log an info message in dmesg to notify the user that the capture
might have incorrect data.
2) ioctl: in this case we return a -EIO error to userspace
3) unabortable actions: these are scenarios where we can't simply abort
and retry and so it's better to just try it anyway because there is a
chance the HW is awake even with the failure. In this case we throw a
warning so we know there was a forcewake problem if something fails
down the line.
v2: use gt_WARN_ON where appropriate
Signed-off-by: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com >
Cc: Tejas Upadhyay <tejas.upadhyay@intel.com >
Reviewed-by: Matt Roper <matthew.d.roper@intel.com >
Reviewed-by: Tejas Upadhyay <tejas.upadhyay@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20240318154924.3453513-1-daniele.ceraolospurio@intel.com
2024-03-20 14:13:58 -07:00
Radhakrishna Sripada
0267ee1914
drm/xe/xelpg: Add Wa_14020495402
...
Disable clockgating for TDL SVHS fub.
v2: Extend the Wa to 1274(MattR)
Bspec: 46045
Reviewed-by: Matt Roper <matthew.d.roper@intel.com >
Signed-off-by: Radhakrishna Sripada <radhakrishna.sripada@intel.com >
Reviewed-by: Matt Roper <matthew.d.roper@intel.com >
Signed-off-by: Matt Roper <matthew.d.roper@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20240318210120.564692-1-radhakrishna.sripada@intel.com
2024-03-20 12:29:17 -07:00
Tejas Upadhyay
dd1c61057e
drm/xe/gt: Remove continue statement which has no effect
...
Remove continue statement which does not have real effect
as no actions are to be taken post continue.
Signed-off-by: Tejas Upadhyay <tejas.upadhyay@intel.com >
Reviewed-by: Himal Prasad Ghimiray <himal.prasad.ghimiray@intel.com >
Acked-by: Lucas De Marchi <lucas.demarchi@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20240318114057.3831274-1-tejas.upadhyay@intel.com
Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com >
2024-03-20 10:11:48 -07:00
Luca Coelho
3896b1695f
drm/xe/display: fix type of intel_uncore_read*() functions
...
Some of the backported intel_uncore_read*() functions used the wrong
types. Change the function declarations accordingly.
Reviewed-by: Gustavo Sousa <gustavo.sousa@intel.com >
Signed-off-by: Luca Coelho <luciano.coelho@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20240314065221.1181158-1-luciano.coelho@intel.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com >
2024-03-20 12:10:07 +02:00
Maarten Lankhorst
a825cef2e7
drm/xe: Move xe_ggtt_invalidate out from ggtt->lock
...
Considering the caller of the GGTT functions should keep the
backing storage alive before the function completes, it's not
necessary to invalidate with the GGTT lock held. This just adds
latency for every user of the GGTT.
Signed-off-by: Matthew Brost <matthew.brost@intel.com >
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com >
Reviewed-by: Matthew Brost <matthew.brost@intel.com >
Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com >
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20240306052002.311196-5-matthew.brost@intel.com
2024-03-20 10:49:14 +01:00
Matthew Brost
231c411087
drm/xe: Add XE_BO_GGTT_INVALIDATE flag
...
Add XE_BO_GGTT_INVALIDATE flag which indicates the GGTT should be
invalidated when a BO is added / removed from the GGTT. This is
typically set when a BO is used by the GuC as the GuC has GGTT TLBs.
Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com >
Signed-off-by: Matthew Brost <matthew.brost@intel.com >
[mlankhorst: Small fix to only inherit GGTT_INVALIDATE from src bo]
[mlankhorst: Remove _BIT from name]
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20240306052002.311196-4-matthew.brost@intel.com
2024-03-20 10:49:14 +01:00
Matthew Brost
72bae5c281
drm/xe: Drop ggtt invalidate from display code
...
Only buffers mapped in the GGTT used by the GuC require an invalidation.
Display buffers do not require an invalidation. Delete the invalidatio
from display code and make invalidation a static function in xe_ggtt.c.
Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com >
Signed-off-by: Matthew Brost <matthew.brost@intel.com >
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20240306052002.311196-3-matthew.brost@intel.com
2024-03-20 10:49:13 +01:00
Nirmoy Das
a6eff8f9c7
drm/xe: Add a NULL check in xe_ttm_stolen_mgr_init
...
Add an explicit check to ensure that the mgr is not NULL.
Cc: Matthew Auld <matthew.auld@intel.com >
Signed-off-by: Nirmoy Das <nirmoy.das@intel.com >
Reviewed-by: Matthew Auld <matthew.auld@intel.com >
Signed-off-by: Matthew Auld <matthew.auld@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20240319130925.22399-1-nirmoy.das@intel.com
2024-03-20 08:58:01 +00:00
Niranjana Vishwanathapura
c9cc3d6586
drm/xe: Use correct function pointer type
...
Use xe_exec_queue_user_extension_fn type for
exec_queue_user_extension_funcs.`
Signed-off-by: Niranjana Vishwanathapura <niranjana.vishwanathapura@intel.com >
Reviewed-by: Ashutosh Dixit <ashutosh.dixit@intel.com >
Signed-off-by: Matthew Brost <matthew.brost@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20240319174919.1847-1-niranjana.vishwanathapura@intel.com
2024-03-19 22:36:38 -07:00
Niranjana Vishwanathapura
260fa80d4a
drm/xe: Streamline exec queue freeing path
...
Ensure exec queue freeing happens at one place, that is in
__xe_exec_queue_free(). It releases q->vm reference also. Set
q->vm before handling extensions as they can potentially reference it.
Signed-off-by: Niranjana Vishwanathapura <niranjana.vishwanathapura@intel.com >
Reviewed-by: Matthew Brost <matthew.brost@intel.com >
Signed-off-by: Matthew Brost <matthew.brost@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20240319175947.15890-1-niranjana.vishwanathapura@intel.com
2024-03-19 22:36:30 -07:00
Niranjana Vishwanathapura
aacf3f629a
drm/xe: Separate out sched/deregister_done handling
...
Abstract out the core part of sched_done and deregister_done handlers
to separate functions to decouple them from any protocol error handling
part and make them more readable.
Signed-off-by: Niranjana Vishwanathapura <niranjana.vishwanathapura@intel.com >
Reviewed-by: Matthew Brost <matthew.brost@intel.com >
Signed-off-by: Matthew Brost <matthew.brost@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20240319184153.16667-1-niranjana.vishwanathapura@intel.com
2024-03-19 22:36:15 -07:00
Daniele Ceraolo Spurio
43c4ff3ca2
drm/xe/guc: Don't support older GuC 70.x releases
...
Supporting older GuC versions comes with baggage, both on the coding
side (due to interfaces only being available from a certain version
onwards) and on the testing side (due to having to make sure the driver
works as expected with older GuCs).
Since all of our Xe platform are still under force probe, we haven't
committed to support any specific GuC version and we therefore don't
need to support the older once, which means that we can force a bottom
limit to what GuC we accept. This allows us to remove any conditional
statements based on older GuC versions and also to approach newer
additions knowing that we'll never attempt to load something older
than our minimum requirement.
As an initial value, the minimum expected version is set to 70.19,
which is the version currently in the firmware table, but the
expectation is that this will be bumbed every time we update the
table, until we remove the force probe.
Signed-off-by: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com >
Cc: John Harrison <John.C.Harrison@Intel.com >
Cc: Lucas De Marchi <lucas.demarchi@intel.com >
Cc: Matt Roper <matthew.d.roper@intel.com >
Cc: Matthew Brost <matthew.brost@intel.com >
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com >
Reviewed-by: Lucas De Marchi <lucas.demarchi@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20240304162616.824884-1-daniele.ceraolospurio@intel.com
2024-03-19 12:14:02 -07:00
Rodrigo Vivi
f7f24b7950
drm/xe: Add dbg messages on the suspend resume functions.
...
In case of the suspend/resume flow getting locked up we
can get reports with some useful hints on where it might
get locked and if that has failed.
Reviewed-by: Matthew Auld <matthew.auld@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20240318180141.267458-2-rodrigo.vivi@intel.com
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com >
2024-03-19 13:07:10 -04:00
Rodrigo Vivi
2920c2cbbd
drm/xe: Convert gt suspend/resume messages to debug
...
Let's be quieter on production configuration and let's also
print the entry point of the gt suspend when debug messages
are enabled.
Reviewed-by: Matthew Auld <matthew.auld@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20240318180141.267458-1-rodrigo.vivi@intel.com
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com >
2024-03-19 13:07:10 -04:00
Himal Prasad Ghimiray
bd415be89e
drm/xe/vm : Remove duplicate assignment of XE_VM_FLAG_LR_MODE flag.
...
vm->flags are already assigned with passed flags. Remove the redundant
assignment.
Cc: Matthew Brost <matthew.brost@intel.com >
Signed-off-by: Himal Prasad Ghimiray <himal.prasad.ghimiray@intel.com >
Reviewed: Matthew Brost <matthew.brost@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20240307065213.1968688-1-himal.prasad.ghimiray@intel.com
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com >
2024-03-19 12:14:09 -04:00
Juha-Pekka Heikkila
1997eeeac5
drm/xe/display: Mark dpt and related vma as uncached
...
Mark dpt and related vma as uncached to avoid pipe faults on some devices.
Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com >
Reviewed-by: Matthew Auld <matthew.auld@intel.com >
Signed-off-by: Matthew Auld <matthew.auld@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20240318201850.127785-1-juhapekka.heikkila@gmail.com
2024-03-19 09:09:41 +00:00
Matthew Auld
2a4172be40
drm/xe/display: mark DPT with XE_BO_PAGETABLE
...
Otherwise in the case where we use normal system memory, the CPU access
will always be cached, like when filling the DPT PTEs, which is likely
not what we want since HW access could be incoherent on platforms like
LNL. Marking as XE_BO_PAGETABLE will force wc/uc underneath on such
platforms.
Signed-off-by: Matthew Auld <matthew.auld@intel.com >
Cc: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com >
Reviewed-by: Lucas De Marchi <lucas.demarchi@intel.com >
Reviewed-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20240314164905.239449-2-matthew.auld@intel.com
2024-03-19 09:08:40 +00:00
Nirmoy Das
f87cf2877b
drm/xe: Remove usage of unsafe strcpy
...
Remove usage of unsafe strcpy with a helper function
to convert engine class to string.
Cc: Matthew Auld <matthew.auld@intel.com >
Signed-off-by: Nirmoy Das <nirmoy.das@intel.com >
Reviewed-by: Matthew Auld <matthew.auld@intel.com >
Signed-off-by: Matthew Auld <matthew.auld@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20240318091055.638-1-nirmoy.das@intel.com
2024-03-19 08:59:59 +00:00
Nirmoy Das
6d74e387aa
drm/xe: Drop bogus vma NULL check
...
The vma pointer can't be NULL here.
Cc: Matthew Auld <matthew.auld@intel.com >
Signed-off-by: Nirmoy Das <nirmoy.das@intel.com >
Reviewed-by: Matthew Auld <matthew.auld@intel.com >
Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com >
Signed-off-by: Matthew Auld <matthew.auld@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20240318093547.16326-1-nirmoy.das@intel.com
2024-03-19 08:58:42 +00:00
Matthew Auld
a96cd71ec7
drm/xe/device: fix XE_MAX_TILES_PER_DEVICE check
...
Here XE_MAX_TILES_PER_DEVICE is the gt array size, therefore the gt
index should always be less than.
v2 (Lucas):
- Add fixes tag.
Fixes: dd08ebf6c3 ("drm/xe: Introduce a new DRM driver for Intel GPUs")
Signed-off-by: Matthew Auld <matthew.auld@intel.com >
Cc: Nirmoy Das <nirmoy.das@intel.com >
Reviewed-by: Nirmoy Das <nirmoy.das@intel.com >
Acked-by: Lucas De Marchi <lucas.demarchi@intel.com >
Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20240318180532.57522-6-matthew.auld@intel.com
2024-03-19 08:49:00 +00:00
Matthew Auld
a5ef563b1d
drm/xe/device: fix XE_MAX_GT_PER_TILE check
...
Here XE_MAX_GT_PER_TILE is the total, therefore the gt index should
always be less than.
Fixes: dd08ebf6c3 ("drm/xe: Introduce a new DRM driver for Intel GPUs")
Signed-off-by: Matthew Auld <matthew.auld@intel.com >
Cc: Nirmoy Das <nirmoy.das@intel.com >
Reviewed-by: Nirmoy Das <nirmoy.das@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20240318180532.57522-5-matthew.auld@intel.com
2024-03-19 08:47:49 +00:00
Matthew Auld
fe87b7dfcb
drm/xe/queue: fix engine_class bounds check
...
The engine_class is the index into the user_to_xe_engine_class,
therefore it needs to be less than.
Fixes: dd08ebf6c3 ("drm/xe: Introduce a new DRM driver for Intel GPUs")
Signed-off-by: Matthew Auld <matthew.auld@intel.com >
Cc: Nirmoy Das <nirmoy.das@intel.com >
Reviewed-by: Nirmoy Das <nirmoy.das@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20240318180532.57522-4-matthew.auld@intel.com
2024-03-19 08:47:47 +00:00
Nirmoy Das
4f4fcafde3
drm/xe: Fix potential integer overflow in page size calculation
...
Explicitly cast tbo->page_alignment to u64 before bit-shifting to
prevent overflow when assigning to min_page_size.
Cc: Matthew Auld <matthew.auld@intel.com >
Cc: Matthew Brost <matthew.brost@intel.com >
Signed-off-by: Nirmoy Das <nirmoy.das@intel.com >
Reviewed-by: Matthew Auld <matthew.auld@intel.com >
Signed-off-by: Matthew Auld <matthew.auld@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20240318164342.3094-1-nirmoy.das@intel.com
2024-03-19 08:33:42 +00:00
Matthew Auld
1d3c830574
drm/xe/vm: fix xe_assert()
...
The region can be used an index into the region_to_mem_type, so we
should be asserting that it is less than the ARRAY_SIZE here.
Signed-off-by: Matthew Auld <matthew.auld@intel.com >
Cc: Nirmoy Das <nirmoy.das@intel.com >
Reviewed-by: Nirmoy Das <nirmoy.das@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20240318103616.26240-2-matthew.auld@intel.com
2024-03-19 08:32:34 +00:00
Matthew Auld
ab0c5aba32
drm/xe/client: drop bogus bo NULL check
...
If we fished it out the list then it can't be null; the list entry is
embedded in the bo.
Signed-off-by: Matthew Auld <matthew.auld@intel.com >
Cc: Nirmoy Das <nirmoy.das@intel.com >
Reviewed-by: Nirmoy Das <nirmoy.das@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20240318093431.21075-4-matthew.auld@intel.com
2024-03-19 08:31:43 +00:00
Matthew Auld
10ed10c279
drm/xe/client: remove bogus rcu list usage
...
We use plain spinlock to protect readers and writers, so there is no
actual RCU here. Rather use the more appropriate non-rcu list based API.
Signed-off-by: Matthew Auld <matthew.auld@intel.com >
Cc: Nirmoy Das <nirmoy.das@intel.com >
Reviewed-by: Nirmoy Das <nirmoy.das@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20240318093431.21075-3-matthew.auld@intel.com
2024-03-19 08:31:41 +00:00
Michal Wajdeczko
df26ac9464
drm/xe/pf: Always select Multi-Level LMTT for platforms 12.60+
...
The Multi-Level LMTT variant is not specific only to the PVC.
Change logic to select it for all new platforms beyond 12.60.
Bspec: 52404, 67468
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com >
Cc: Michał Winiarski <michal.winiarski@intel.com >
Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com >
Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20240313104132.1045-4-michal.wajdeczko@intel.com
Signed-off-by: Michał Winiarski <michal.winiarski@intel.com >
2024-03-15 22:20:52 +01:00
Michal Wajdeczko
28b2a21892
drm/xe/pf: Request 64K aligned allocations for LMTT PD
...
The LMTT Page Directory, as well as the directory entries, must be
aligned on a 64KB boundary in VRAM. Use explicit alignment flag to
match hardware requirement.
Bspec: 52404, 67468
Cc: Michał Winiarski <michal.winiarski@intel.com >
Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com >
Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20240313104132.1045-3-michal.wajdeczko@intel.com
Signed-off-by: Michał Winiarski <michal.winiarski@intel.com >
2024-03-15 22:20:52 +01:00
Michal Wajdeczko
6583b0839a
drm/xe: Allow VRAM BO allocations aligned to 64K
...
While today we are getting VRAM allocations aligned to 64K as the
XE_VRAM_FLAGS_NEED64K flag could be set, we shouldn't only rely on
that flag and we should also allow caller to specify required 64K
alignment explicitly. Define new XE_BO_NEEDS_64K flag for that.
Cc: Matt Roper <matthew.d.roper@intel.com >
Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com >
Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20240313104132.1045-2-michal.wajdeczko@intel.com
Signed-off-by: Michał Winiarski <michal.winiarski@intel.com >
2024-03-15 22:20:52 +01:00
Michal Wajdeczko
54c659660d
drm/xe: Make xe_mmio_read|write() functions non-inline
...
Shortly we will updating xe_mmio_read|write() functions with SR-IOV
specific features making those functions less suitable for inline.
Convert now those functions into regular ones, lowering driver
footprint, according to scripts/bloat-o-meter, by 6%
add/remove: 18/18 grow/shrink: 31/603 up/down: 2719/-79663 (-76944)
Function old new delta
Total: Before=1276633, After=1199689, chg -6.03%
add/remove: 0/0 grow/shrink: 0/0 up/down: 0/0 (0)
Data old new delta
Total: Before=48990, After=48990, chg +0.00%
add/remove: 0/0 grow/shrink: 0/0 up/down: 0/0 (0)
RO Data old new delta
Total: Before=115680, After=115680, chg +0.00%
Reviewed-by: Matt Roper <matthew.d.roper@intel.com >
Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20240314173130.1177-7-michal.wajdeczko@intel.com
Signed-off-by: Michał Winiarski <michal.winiarski@intel.com >
2024-03-15 22:20:14 +01:00
Michal Wajdeczko
42b266be32
drm/xe: Mark VF accessible interrupt registers
...
Interrupt registers 1900xx are VF accessible but only until version
12.50 as on newer platforms VFs are using memory-based interrupts.
To avoid complexity, we mark those registers with XE_REG_OPTION_VF
unconditionally, as IRQ handling on newer VFs is different anyway.
Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com >
Cc: Matt Roper <matthew.d.roper@intel.com >
Reviewed-by: Matt Roper <matthew.d.roper@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20240314173130.1177-6-michal.wajdeczko@intel.com
Signed-off-by: Michał Winiarski <michal.winiarski@intel.com >
2024-03-15 22:20:14 +01:00
Michal Wajdeczko
50707fdb6e
drm/xe: Mark VF accessible global registers
...
Only selected registers are available for Virtual Functions.
Reviewed-by: Matt Roper <matthew.d.roper@intel.com >
Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20240314173130.1177-5-michal.wajdeczko@intel.com
Signed-off-by: Michał Winiarski <michal.winiarski@intel.com >
2024-03-15 22:20:14 +01:00