Natanel Roizenman
a99d819375
drm/amd/display: Increase Z8 watermark times.
...
Increase Z8 watermark times from 210->250us and 320->350us.
Reviewed-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com >
Acked-by: Wayne Lin <wayne.lin@amd.com >
Signed-off-by: Natanel Roizenman <natanel.roizenman@amd.com >
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2024-03-27 08:49:41 -04:00
Mukul Joshi
9d7993a7ab
drm/amdkfd: Check cgroup when returning DMABuf info
...
Check cgroup permissions when returning DMA-buf info and
based on cgroup info return the GPU id of the GPU that have
access to the BO.
Signed-off-by: Mukul Joshi <mukul.joshi@amd.com >
Reviewed-by: Felix Kuehling <felix.kuehling@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2024-03-27 08:49:29 -04:00
lima1002
075ec16474
drm/amd/swsmu: add smu 14.0.1 vcn and jpeg msg
...
add new vcn and jpeg msg
v2: squash in updates (Alex)
v3: rework code for better compat with other smu14.x variants (Alex)
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Signed-off-by: lima1002 <li.ma@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2024-03-27 08:49:13 -04:00
Andy Yan
905f7d53a1
drm/rockchip: vop2: Remove AR30 and AB30 format support
...
The Alpha blending for 30 bit RGB/BGR are not
functioning properly for rk3568/rk3588, so remove
it from the format list.
Fixes: bfd8a5c228 ("drm/rockchip: vop2: Add more supported 10bit formats")
Signed-off-by: Andy Yan <andy.yan@rock-chips.com >
Acked-by: Sascha Hauer <s.hauer@pengutronix.de >
Signed-off-by: Heiko Stuebner <heiko@sntech.de >
Link: https://patchwork.freedesktop.org/patch/msgid/20240304100952.3592984-1-andyshrk@163.com
2024-03-26 09:48:26 +01:00
Thomas Zimmermann
36a1818f5a
Merge drm/drm-fixes into drm-misc-fixes
...
Backmerging to get drm-misc-fixes to the state of v6.9-rc1.
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de >
2024-03-25 21:11:58 +01:00
Lucas De Marchi
0d8cf0c924
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 >
(cherry picked from commit 35b22649eb )
Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com >
2024-03-25 13:47:48 -05:00
Matthew Auld
45c30b2923
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
(cherry picked from commit 4b275f502a )
Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com >
2024-03-25 13:45:32 -05:00
Matthew Auld
b45f20fa69
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
(cherry picked from commit a96cd71ec7 )
Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com >
2024-03-25 13:45:32 -05:00
Matthew Auld
23e1ee3a23
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
(cherry picked from commit a5ef563b1d )
Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com >
2024-03-25 13:45:32 -05:00
Matthew Auld
b7dce525c4
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
(cherry picked from commit fe87b7dfcb )
Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com >
2024-03-25 13:45:32 -05:00
Matthew Auld
9c1256369c
drm/xe/guc_submit: use jiffies for job timeout
...
drm_sched_init() expects jiffies for the timeout, but here we are
passing the timeout in ms. Convert to jiffies instead.
Fixes: eef55700f3 ("drm/xe: Add sysfs for default engine scheduler properties")
Signed-off-by: Matthew Auld <matthew.auld@intel.com >
Cc: Matthew Brost <matthew.brost@intel.com >
Reviewed-by: Nirmoy Das <nirmoy.das@intel.com >
Reviewed-by: Matthew Brost <matthew.brost@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20240314121554.223229-2-matthew.auld@intel.com
Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com >
(cherry picked from commit 2c5b70f74d )
Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com >
2024-03-25 13:45:32 -05:00
Nirmoy Das
fd00fe8cdb
drm/xe: Remove unused xe_bo->props struct
...
Property struct is not being used so remove it and related dead code.
Fixes: ddfa2d6a84 ("drm/xe/uapi: Kill VM_MADVISE IOCTL")
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com >
Cc: Thomas Hellström <thomas.hellstrom@linux.intel.com >
Cc: intel-xe@lists.freedesktop.org
Signed-off-by: Nirmoy Das <nirmoy.das@intel.com >
Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20240311151159.10036-1-nirmoy.das@intel.com
Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com >
(cherry picked from commit 002d8f0b4f )
Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com >
2024-03-25 13:45:32 -05:00
Linus Torvalds
7ee0490121
Merge tag 'drm-next-2024-03-22' of https://gitlab.freedesktop.org/drm/kernel
...
Pull drm fixes from Dave Airlie:
"Fixes from the last week (or 3 weeks in amdgpu case), after amdgpu,
it's xe and nouveau then a few scattered core fixes.
core:
- fix rounding in drm_fixp2int_round()
bridge:
- fix documentation for DRM_BRIDGE_OP_EDID
sun4i:
- fix 64-bit division on 32-bit architectures
tests:
- fix dependency on DRM_KMS_HELPER
probe-helper:
- never return negative values from .get_modes() plus driver fixes
xe:
- invalidate userptr vma on page pin fault
- fail early on sysfs file creation error
- skip VMA pinning on xe_exec if no batches
nouveau:
- clear bo resource bus after eviction
- documentation fixes
- don't check devinit disable on GSP
amdgpu:
- Freesync fixes
- UAF IOCTL fixes
- Fix mmhub client ID mapping
- IH 7.0 fix
- DML2 fixes
- VCN 4.0.6 fix
- GART bind fix
- GPU reset fix
- SR-IOV fix
- OD table handling fixes
- Fix TA handling on boards without display hardware
- DML1 fix
- ABM fix
- eDP panel fix
- DPPCLK fix
- HDCP fix
- Revert incorrect error case handling in ioremap
- VPE fix
- HDMI fixes
- SDMA 4.4.2 fix
- Other misc fixes
amdkfd:
- Fix duplicate BO handling in process restore"
* tag 'drm-next-2024-03-22' of https://gitlab.freedesktop.org/drm/kernel: (50 commits)
drm/amdgpu/pm: Don't use OD table on Arcturus
drm/amdgpu: drop setting buffer funcs in sdma442
drm/amd/display: Fix noise issue on HDMI AV mute
drm/amd/display: Revert Remove pixle rate limit for subvp
Revert "drm/amdgpu/vpe: don't emit cond exec command under collaborate mode"
Revert "drm/amd/amdgpu: Fix potential ioremap() memory leaks in amdgpu_device_init()"
drm/amd/display: Add a dc_state NULL check in dc_state_release
drm/amd/display: Return the correct HDCP error code
drm/amd/display: Implement wait_for_odm_update_pending_complete
drm/amd/display: Lock all enabled otg pipes even with no planes
drm/amd/display: Amend coasting vtotal for replay low hz
drm/amd/display: Fix idle check for shared firmware state
drm/amd/display: Update odm when ODM combine is changed on an otg master pipe with no plane
drm/amd/display: Init DPPCLK from SMU on dcn32
drm/amd/display: Add monitor patch for specific eDP
drm/amd/display: Allow dirty rects to be sent to dmub when abm is active
drm/amd/display: Override min required DCFCLK in dml1_validate
drm/amdgpu: Bypass display ta if display hw is not available
drm/amdgpu: correct the KGQ fallback message
drm/amdgpu/pm: Check the validity of overdiver power limit
...
2024-03-21 19:04:31 -07:00
Dave Airlie
cafd86cbdc
Merge tag 'amd-drm-fixes-6.9-2024-03-21' of https://gitlab.freedesktop.org/agd5f/linux into drm-next
...
amd-drm-fixes-6.9-2024-03-21:
amdgpu:
- Freesync fixes
- UAF IOCTL fixes
- Fix mmhub client ID mapping
- IH 7.0 fix
- DML2 fixes
- VCN 4.0.6 fix
- GART bind fix
- GPU reset fix
- SR-IOV fix
- OD table handling fixes
- Fix TA handling on boards without display hardware
- DML1 fix
- ABM fix
- eDP panel fix
- DPPCLK fix
- HDCP fix
- Revert incorrect error case handling in ioremap
- VPE fix
- HDMI fixes
- SDMA 4.4.2 fix
- Other misc fixes
amdkfd:
- Fix duplicate BO handling in process restore
Signed-off-by: Dave Airlie <airlied@redhat.com >
From: Alex Deucher <alexander.deucher@amd.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20240321220514.1418288-1-alexander.deucher@amd.com
2024-03-22 10:34:12 +10:00
Dave Airlie
921074ab8e
Merge tag 'drm-misc-next-fixes-2024-03-21' of https://gitlab.freedesktop.org/drm/misc/kernel into drm-next
...
Short summary of fixes pull:
core:
- fix rounding in drm_fixp2int_round()
bridge:
- fix documentation for DRM_BRIDGE_OP_EDID
nouveau:
- don't check devinit disable on GSP
sun4i:
- fix 64-bit division on 32-bit architectures
tests:
- fix dependency on DRM_KMS_HELPER
Signed-off-by: Dave Airlie <airlied@redhat.com >
From: Thomas Zimmermann <tzimmermann@suse.de >
Link: https://patchwork.freedesktop.org/patch/msgid/20240321161948.GA30430@linux.fritz.box
2024-03-22 09:59:03 +10:00
Ma Jun
bc55c344b0
drm/amdgpu/pm: Don't use OD table on Arcturus
...
OD is not supported on Arcturus, so the OD table
should not be used.
Signed-off-by: Ma Jun <Jun.Ma2@amd.com >
Acked-by: Alex Deucher <alexander.deucher@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2024-03-20 13:36:29 -04:00
Le Ma
ad550dbe8a
drm/amdgpu: drop setting buffer funcs in sdma442
...
To fix the entity rq NULL issue. This setting has been moved
to upper level.
Fixes: b70438004a ("drm/amdgpu: move buffer funcs setting up a level")
Signed-off-by: Le Ma <le.ma@amd.com >
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2024-03-20 13:36:29 -04:00
Leo Ma
69e3be6893
drm/amd/display: Fix noise issue on HDMI AV mute
...
[Why]
When mode switching is triggered there is momentary noise visible on
some HDMI TV or displays.
[How]
Wait for 2 frames to make sure we have enough time to send out AV mute
and sink receives a full frame.
Cc: Mario Limonciello <mario.limonciello@amd.com >
Cc: Alex Deucher <alexander.deucher@amd.com >
Cc: stable@vger.kernel.org
Reviewed-by: Wenjing Liu <wenjing.liu@amd.com >
Acked-by: Wayne Lin <wayne.lin@amd.com >
Signed-off-by: Leo Ma <hanghong.ma@amd.com >
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2024-03-20 13:36:29 -04:00
Wenjing Liu
cf8c498694
drm/amd/display: Revert Remove pixle rate limit for subvp
...
This reverts commit 340383c734 ("drm/amd/display: Remove pixle rate
limit for subvp")
[why]
The original commit causes a regression when subvp is applied
on ODM required 8k60hz timing. The display shows black screen
on boot. The issue can be recovered with hotplug. It also causes
MPO to fail. We will temprarily revert this commit and investigate
the root cause further.
Cc: Mario Limonciello <mario.limonciello@amd.com >
Cc: Alex Deucher <alexander.deucher@amd.com >
Cc: stable@vger.kernel.org
Reviewed-by: Chaitanya Dhere <chaitanya.dhere@amd.com >
Reviewed-by: Martin Leung <martin.leung@amd.com >
Acked-by: Wayne Lin <wayne.lin@amd.com >
Signed-off-by: Wenjing Liu <wenjing.liu@amd.com >
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2024-03-20 13:12:59 -04:00
Lang Yu
1b7eec6bf3
Revert "drm/amdgpu/vpe: don't emit cond exec command under collaborate mode"
...
Ready now. Remove this workaround.
This reverts commit d40f6213b5 .
Signed-off-by: Lang Yu <Lang.Yu@amd.com >
Tested-by: Alan Liu <haoping.liu@amd.com >
Acked-by: Alex Deucher <alexander.deucher@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2024-03-20 13:12:59 -04:00
Ma Jun
03c6284df1
Revert "drm/amd/amdgpu: Fix potential ioremap() memory leaks in amdgpu_device_init()"
...
This patch causes the following iounmap erorr and calltrace
iounmap: bad address 00000000d0b3631f
The original patch was unjustified because amdgpu_device_fini_sw() will
always cleanup the rmmio mapping.
This reverts commit eb4f139888 .
Signed-off-by: Ma Jun <Jun.Ma2@amd.com >
Suggested-by: Christian König <christian.koenig@amd.com >
Reviewed-by: Christian König <christian.koenig@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2024-03-20 13:12:59 -04:00
Allen Pan
334b56cea5
drm/amd/display: Add a dc_state NULL check in dc_state_release
...
[How]
Check wheather state is NULL before releasing it.
Cc: Mario Limonciello <mario.limonciello@amd.com >
Cc: Alex Deucher <alexander.deucher@amd.com >
Cc: stable@vger.kernel.org
Reviewed-by: Charlene Liu <charlene.liu@amd.com >
Acked-by: Alex Hung <alex.hung@amd.com >
Signed-off-by: Allen Pan <allen.pan@amd.com >
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2024-03-20 13:12:59 -04:00
Rodrigo Siqueira
e64b3f55e4
drm/amd/display: Return the correct HDCP error code
...
[WHY & HOW]
If the display is null when creating an HDCP session, return a proper
error code.
Cc: Mario Limonciello <mario.limonciello@amd.com >
Cc: Alex Deucher <alexander.deucher@amd.com >
Cc: stable@vger.kernel.org
Acked-by: Alex Hung <alex.hung@amd.com >
Signed-off-by: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com >
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2024-03-20 13:12:59 -04:00
Wenjing Liu
2d7f3d1a58
drm/amd/display: Implement wait_for_odm_update_pending_complete
...
[WHY]
Odm update is doubled buffered. We need to wait for ODM update to be
completed before optimizing bandwidth or programming new udpates.
[HOW]
implement wait_for_odm_update_pending_complete function to wait for:
1. odm configuration update is no longer pending in timing generator.
2. no pending dpg pattern update for each active OPP.
Cc: Mario Limonciello <mario.limonciello@amd.com >
Cc: Alex Deucher <alexander.deucher@amd.com >
Cc: stable@vger.kernel.org
Reviewed-by: Alvin Lee <alvin.lee2@amd.com >
Acked-by: Alex Hung <alex.hung@amd.com >
Signed-off-by: Wenjing Liu <wenjing.liu@amd.com >
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2024-03-20 13:12:58 -04:00
Wenjing Liu
94040c2cbb
drm/amd/display: Lock all enabled otg pipes even with no planes
...
[WHY]
On DCN32 we support dynamic ODM even when OTG is blanked. When ODM
configuration is dynamically changed and the OTG is on blank pattern,
we will need to reprogram OPP's test pattern based on new ODM
configuration. Therefore we need to lock the OTG pipe to avoid temporary
corruption when we are reprogramming OPP blank patterns.
[HOW]
Add a new interdependent update lock implementation to lock all enabled
OTG pipes even when there is no plane on the OTG for DCN32.
Cc: Mario Limonciello <mario.limonciello@amd.com >
Cc: Alex Deucher <alexander.deucher@amd.com >
Cc: stable@vger.kernel.org
Reviewed-by: Alvin Lee <alvin.lee2@amd.com >
Acked-by: Alex Hung <alex.hung@amd.com >
Signed-off-by: Wenjing Liu <wenjing.liu@amd.com >
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2024-03-20 13:12:58 -04:00
ChunTao Tso
8e054b0f1e
drm/amd/display: Amend coasting vtotal for replay low hz
...
[WHY]
The original coasting vtotal is 2 bytes, and it need to
be amended to 4 bytes because low hz case.
[HOW]
Amend coasting vtotal from 2 bytes to 4 bytes.
Cc: Mario Limonciello <mario.limonciello@amd.com >
Cc: Alex Deucher <alexander.deucher@amd.com >
Cc: stable@vger.kernel.org
Reviewed-by: Alvin Lee <alvin.lee2@amd.com >
Acked-by: Alex Hung <alex.hung@amd.com >
Signed-off-by: ChunTao Tso <chuntao.tso@amd.com >
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2024-03-20 13:12:58 -04:00
Nicholas Kazlauskas
3d066f9547
drm/amd/display: Fix idle check for shared firmware state
...
[WHY]
We still had an instance of get_idle_state checking the PMFW scratch
register instead of the actual idle allow signal.
[HOW]
Replace it with the SW state check for whether we had allowed idle
through notify_idle.
Cc: Mario Limonciello <mario.limonciello@amd.com >
Cc: Alex Deucher <alexander.deucher@amd.com >
Cc: stable@vger.kernel.org
Reviewed-by: Duncan Ma <duncan.ma@amd.com >
Acked-by: Alex Hung <alex.hung@amd.com >
Signed-off-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com >
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2024-03-20 13:12:58 -04:00
Wenjing Liu
86e9523fb0
drm/amd/display: Update odm when ODM combine is changed on an otg master pipe with no plane
...
[WHY]
When committing an update with ODM combine change when the plane is
removing or already removed, we fail to detect odm change in pipe
update flags. This has caused mismatch between new dc state and the
actual hardware state, because we missed odm programming.
[HOW]
- Detect odm change even for otg master pipe without a plane.
- Update odm config before calling program pipes for pipe with planes.
The commit also updates blank pattern programming when odm is changed
without plane. This is because number of OPP is changed when ODM
combine is changed. Blank pattern is per OPP so we will need to
reprogram OPP based on the new pipe topology.
Cc: Mario Limonciello <mario.limonciello@amd.com >
Cc: Alex Deucher <alexander.deucher@amd.com >
Cc: stable@vger.kernel.org
Reviewed-by: Dillon Varone <dillon.varone@amd.com >
Acked-by: Alex Hung <alex.hung@amd.com >
Signed-off-by: Wenjing Liu <wenjing.liu@amd.com >
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2024-03-20 13:12:58 -04:00
Dillon Varone
4f5b8d78ca
drm/amd/display: Init DPPCLK from SMU on dcn32
...
[WHY & HOW]
DPPCLK ranges should be obtained from the SMU when available.
Cc: Mario Limonciello <mario.limonciello@amd.com >
Cc: Alex Deucher <alexander.deucher@amd.com >
Cc: stable@vger.kernel.org
Reviewed-by: Chaitanya Dhere <chaitanya.dhere@amd.com >
Acked-by: Alex Hung <alex.hung@amd.com >
Signed-off-by: Dillon Varone <dillon.varone@amd.com >
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2024-03-20 13:12:58 -04:00
Ryan Lin
04a59c5475
drm/amd/display: Add monitor patch for specific eDP
...
[WHY]
Some eDP panels' ext caps don't write initial values. The value of
dpcd_addr (0x317) can be random and the backlight control interface
will be incorrect.
[HOW]
Add new panel patches to remove sink ext caps.
Cc: Mario Limonciello <mario.limonciello@amd.com >
Cc: Alex Deucher <alexander.deucher@amd.com >
Cc: stable@vger.kernel.org # 6.5.x
Cc: Tsung-hua Lin <tsung-hua.lin@amd.com >
Cc: Chris Chi <moukong.chi@amd.com >
Reviewed-by: Wayne Lin <wayne.lin@amd.com >
Acked-by: Alex Hung <alex.hung@amd.com >
Signed-off-by: Ryan Lin <tsung-hua.lin@amd.com >
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2024-03-20 13:12:58 -04:00
Josip Pavic
7fb19d9510
drm/amd/display: Allow dirty rects to be sent to dmub when abm is active
...
[WHY]
It's beneficial for ABM to know when new frame data are available.
[HOW]
Add new condition to allow dirty rects to be sent to DMUB when ABM is
active. ABM will use this as a signal that a new frame has arrived.
Cc: Mario Limonciello <mario.limonciello@amd.com >
Cc: Alex Deucher <alexander.deucher@amd.com >
Cc: stable@vger.kernel.org
Reviewed-by: Anthony Koo <anthony.koo@amd.com >
Acked-by: Alex Hung <alex.hung@amd.com >
Signed-off-by: Josip Pavic <josip.pavic@amd.com >
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2024-03-20 13:12:58 -04:00
Sohaib Nadeem
26fbcb3da7
drm/amd/display: Override min required DCFCLK in dml1_validate
...
[WHY]:
Increasing min DCFCLK addresses underflow issues that occur when phantom
pipe is turned on for some Sub-Viewport configs
[HOW]:
dcn32_override_min_req_dcfclk is added to override DCFCLK value in
dml1_validate when subviewport is being used.
Cc: Mario Limonciello <mario.limonciello@amd.com >
Cc: Alex Deucher <alexander.deucher@amd.com >
Cc: stable@vger.kernel.org
Reviewed-by: Alvin Lee <alvin.lee2@amd.com >
Acked-by: Alex Hung <alex.hung@amd.com >
Signed-off-by: Sohaib Nadeem <sohaib.nadeem@amd.com >
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2024-03-20 13:12:58 -04:00
Hawking Zhang
9b3fec307f
drm/amdgpu: Bypass display ta if display hw is not available
...
Do not load/invoke display TA if display hardware
is not available.
Signed-off-by: Hawking Zhang <Hawking.Zhang@amd.com >
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2024-03-20 13:12:58 -04:00
Prike Liang
43bda3e782
drm/amdgpu: correct the KGQ fallback message
...
Fix the KGQ fallback function name, as this will
help differentiate the failure in the KCQ enablement.
Signed-off-by: Prike Liang <Prike.Liang@amd.com >
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2024-03-20 13:12:58 -04:00
Ma Jun
e17718251a
drm/amdgpu/pm: Check the validity of overdiver power limit
...
Check the validity of overdriver power limit before using it.
Fixes: 7968e9748f ("drm/amdgpu/pm: Fix the power1_min_cap value")
Signed-off-by: Ma Jun <Jun.Ma2@amd.com >
Suggested-by: Lazar Lijo <lijo.lazar@amd.com >
Suggested-by: Alex Deucher <Alexander.Deucher@amd.com >
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
Cc: stable@vger.kernel.org
2024-03-20 13:12:57 -04:00
Ma Jun
08ae9ef829
drm/amdgpu/pm: Fix NULL pointer dereference when get power limit
...
Because powerplay_table initialization is skipped under
sriov case, We check and set default lower and upper OD
value if powerplay_table is NULL.
Fixes: 7968e9748f ("drm/amdgpu/pm: Fix the power1_min_cap value")
Signed-off-by: Ma Jun <Jun.Ma2@amd.com >
Reported-by: Yin Zhenguo <zhenguo.yin@amd.com >
Suggested-by: Lazar Lijo <lijo.lazar@amd.com >
Suggested-by: Alex Deucher <Alexander.Deucher@amd.com >
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
Cc: stable@vger.kernel.org
2024-03-20 13:12:57 -04:00
ZhenGuo Yin
56b30ac84c
drm/amdgpu: Skip access PF-only registers on gfx10/gfxhub2_1 under SRIOV
...
[Why]
RLCG interface returns "out-of-range" error under SRIOV VF when accessing
PF-only registers.
[How]
Skip access PF-only registers on gfx10/gfxhub2_1 under SRIOV.
Acked-by: Alex Deucher <alexander.deucher@amd.com >
Signed-off-by: ZhenGuo Yin <zhenguo.yin@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2024-03-20 13:12:57 -04:00
Ahmad Rehman
f679fd6057
drm/amdgpu: Init zone device and drm client after mode-1 reset on reload
...
In passthrough environment, when amdgpu is reloaded after unload, mode-1
is triggered after initializing the necessary IPs, That init does not
include KFD, and KFD init waits until the reset is completed. KFD init
is called in the reset handler, but in this case, the zone device and
drm client is not initialized, causing app to create kernel panic.
v2: Removing the init KFD condition from amdgpu_amdkfd_drm_client_create.
As the previous version has the potential of creating DRM client twice.
v3: v2 patch results in SDMA engine hung as DRM open causes VM clear to SDMA
before SDMA init. Adding the condition to in drm client creation, on top of v1,
to guard against drm client creation call multiple times.
Signed-off-by: Ahmad Rehman <Ahmad.Rehman@amd.com >
Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2024-03-20 13:12:57 -04:00
Philip Yang
6c6064cbe5
drm/amdgpu: amdgpu_ttm_gart_bind set gtt bound flag
...
Otherwise after the GTT bo is released, the GTT and gart space is freed
but amdgpu_ttm_backend_unbind will not clear the gart page table entry
and leave valid mapping entry pointing to the stale system page. Then
if GPU access the gart address mistakely, it will read undefined value
instead page fault, harder to debug and reproduce the real issue.
Cc: stable@vger.kernel.org
Signed-off-by: Philip Yang <Philip.Yang@amd.com >
Reviewed-by: Christian König <christian.koenig@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2024-03-20 13:12:57 -04:00
Saleemkhan Jamadar
6a7cbbc267
drm/amdgpu/vcn: enable vcn1 fw load for VCN 4_0_6
...
v1 - update the fw header for each vcn instance (Veera)
VCN1 has different FW binary in VCN v4_0_6.
Add changes to load the VCN1 fw binary
Signed-off-by: Saleemkhan Jamadar <saleemkhan.jamadar@amd.com >
Reviewed-by: Veerabadhran Gopalakrishnan <Veerabadhran.Gopalakrishnan@amd.com >
Reviewed-by: Leo Liu <leo.liu@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2024-03-20 13:12:57 -04:00
Aurabindo Pillai
a568c4947e
drm/amd/display: Enable DML2 debug flags
...
[WHY & HOW]
Enable DML2 related debug config options in DM for testing purposes.
Reviewed-by: Chaitanya Dhere <chaitanya.dhere@amd.com >
Acked-by: Alex Hung <alex.hung@amd.com >
Signed-off-by: Aurabindo Pillai <aurabindo.pillai@amd.com >
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2024-03-20 13:12:57 -04:00
Swapnil Patel
75eb8f7df6
drm/amd/display: Change default size for dummy plane in DML2
...
[WHY & HOW]
Currently, to map dc states into dml_display_cfg,
We create a dummy plane if the stream doesn't have any planes
attached to it. This dummy plane uses max addersable width height.
This results in certain mode validations failing when they shouldn't.
Cc: Mario Limonciello <mario.limonciello@amd.com >
Cc: Alex Deucher <alexander.deucher@amd.com >
Cc: stable@vger.kernel.org
Reviewed-by: Chaitanya Dhere <chaitanya.dhere@amd.com >
Acked-by: Alex Hung <alex.hung@amd.com >
Signed-off-by: Swapnil Patel <swapnil.patel@amd.com >
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2024-03-20 13:12:57 -04:00
Friedrich Vock
c6ba60af01
drm/amdgpu: Reset IH OVERFLOW_EN bit for IH 7.0
...
IH 7.0 support landed shortly after the original patch for resetting the
bit on all other generations, but without that patch applied.
Fixes: 12443fc53e ("drm/amdgpu: Add ih v7_0 ip block support")
Cc: Christian König <christian.koenig@amd.com >
Cc: Alex Deucher <alexander.deucher@amd.com >
Signed-off-by: Friedrich Vock <friedrich.vock@gmx.de >
Reviewed-by: Christian König <christian.koenig@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2024-03-20 13:12:57 -04:00
Lang Yu
6540ff6482
drm/amdgpu: fix mmhub client id out-of-bounds access
...
Properly handle cid 0x140.
Fixes: aba2be4147 ("drm/amdgpu: add mmhub 3.3.0 support")
Signed-off-by: Lang Yu <Lang.Yu@amd.com >
Reviewed-by: Yifan Zhang <yifan1.zhang@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2024-03-20 13:12:57 -04:00
Vitaly Prosyak
22207fd5c8
drm/amdgpu: fix use-after-free bug
...
The bug can be triggered by sending a single amdgpu_gem_userptr_ioctl
to the AMDGPU DRM driver on any ASICs with an invalid address and size.
The bug was reported by Joonkyo Jung <joonkyoj@yonsei.ac.kr >.
For example the following code:
static void Syzkaller1(int fd)
{
struct drm_amdgpu_gem_userptr arg;
int ret;
arg.addr = 0xffffffffffff0000;
arg.size = 0x80000000; /*2 Gb*/
arg.flags = 0x7;
ret = drmIoctl(fd, 0xc1186451/*amdgpu_gem_userptr_ioctl*/, &arg);
}
Due to the address and size are not valid there is a failure in
amdgpu_hmm_register->mmu_interval_notifier_insert->__mmu_interval_notifier_insert->
check_shl_overflow, but we even the amdgpu_hmm_register failure we still call
amdgpu_hmm_unregister into amdgpu_gem_object_free which causes access to a bad address.
The following stack is below when the issue is reproduced when Kazan is enabled:
[ +0.000014] Hardware name: ASUS System Product Name/ROG STRIX B550-F GAMING (WI-FI), BIOS 1401 12/03/2020
[ +0.000009] RIP: 0010:mmu_interval_notifier_remove+0x327/0x340
[ +0.000017] Code: ff ff 49 89 44 24 08 48 b8 00 01 00 00 00 00 ad de 4c 89 f7 49 89 47 40 48 83 c0 22 49 89 47 48 e8 ce d1 2d 01 e9 32 ff ff ff <0f> 0b e9 16 ff ff ff 4c 89 ef e8 fa 14 b3 ff e9 36 ff ff ff e8 80
[ +0.000014] RSP: 0018:ffffc90002657988 EFLAGS: 00010246
[ +0.000013] RAX: 0000000000000000 RBX: 1ffff920004caf35 RCX: ffffffff8160565b
[ +0.000011] RDX: dffffc0000000000 RSI: 0000000000000004 RDI: ffff8881a9f78260
[ +0.000010] RBP: ffffc90002657a70 R08: 0000000000000001 R09: fffff520004caf25
[ +0.000010] R10: 0000000000000003 R11: ffffffff8161d1d6 R12: ffff88810e988c00
[ +0.000010] R13: ffff888126fb5a00 R14: ffff88810e988c0c R15: ffff8881a9f78260
[ +0.000011] FS: 00007ff9ec848540(0000) GS:ffff8883cc880000(0000) knlGS:0000000000000000
[ +0.000012] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[ +0.000010] CR2: 000055b3f7e14328 CR3: 00000001b5770000 CR4: 0000000000350ef0
[ +0.000010] Call Trace:
[ +0.000006] <TASK>
[ +0.000007] ? show_regs+0x6a/0x80
[ +0.000018] ? __warn+0xa5/0x1b0
[ +0.000019] ? mmu_interval_notifier_remove+0x327/0x340
[ +0.000018] ? report_bug+0x24a/0x290
[ +0.000022] ? handle_bug+0x46/0x90
[ +0.000015] ? exc_invalid_op+0x19/0x50
[ +0.000016] ? asm_exc_invalid_op+0x1b/0x20
[ +0.000017] ? kasan_save_stack+0x26/0x50
[ +0.000017] ? mmu_interval_notifier_remove+0x23b/0x340
[ +0.000019] ? mmu_interval_notifier_remove+0x327/0x340
[ +0.000019] ? mmu_interval_notifier_remove+0x23b/0x340
[ +0.000020] ? __pfx_mmu_interval_notifier_remove+0x10/0x10
[ +0.000017] ? kasan_save_alloc_info+0x1e/0x30
[ +0.000018] ? srso_return_thunk+0x5/0x5f
[ +0.000014] ? __kasan_kmalloc+0xb1/0xc0
[ +0.000018] ? srso_return_thunk+0x5/0x5f
[ +0.000013] ? __kasan_check_read+0x11/0x20
[ +0.000020] amdgpu_hmm_unregister+0x34/0x50 [amdgpu]
[ +0.004695] amdgpu_gem_object_free+0x66/0xa0 [amdgpu]
[ +0.004534] ? __pfx_amdgpu_gem_object_free+0x10/0x10 [amdgpu]
[ +0.004291] ? do_syscall_64+0x5f/0xe0
[ +0.000023] ? srso_return_thunk+0x5/0x5f
[ +0.000017] drm_gem_object_free+0x3b/0x50 [drm]
[ +0.000489] amdgpu_gem_userptr_ioctl+0x306/0x500 [amdgpu]
[ +0.004295] ? __pfx_amdgpu_gem_userptr_ioctl+0x10/0x10 [amdgpu]
[ +0.004270] ? srso_return_thunk+0x5/0x5f
[ +0.000014] ? __this_cpu_preempt_check+0x13/0x20
[ +0.000015] ? srso_return_thunk+0x5/0x5f
[ +0.000013] ? sysvec_apic_timer_interrupt+0x57/0xc0
[ +0.000020] ? srso_return_thunk+0x5/0x5f
[ +0.000014] ? asm_sysvec_apic_timer_interrupt+0x1b/0x20
[ +0.000022] ? drm_ioctl_kernel+0x17b/0x1f0 [drm]
[ +0.000496] ? __pfx_amdgpu_gem_userptr_ioctl+0x10/0x10 [amdgpu]
[ +0.004272] ? drm_ioctl_kernel+0x190/0x1f0 [drm]
[ +0.000492] drm_ioctl_kernel+0x140/0x1f0 [drm]
[ +0.000497] ? __pfx_amdgpu_gem_userptr_ioctl+0x10/0x10 [amdgpu]
[ +0.004297] ? __pfx_drm_ioctl_kernel+0x10/0x10 [drm]
[ +0.000489] ? srso_return_thunk+0x5/0x5f
[ +0.000011] ? __kasan_check_write+0x14/0x20
[ +0.000016] drm_ioctl+0x3da/0x730 [drm]
[ +0.000475] ? __pfx_amdgpu_gem_userptr_ioctl+0x10/0x10 [amdgpu]
[ +0.004293] ? __pfx_drm_ioctl+0x10/0x10 [drm]
[ +0.000506] ? __pfx_rpm_resume+0x10/0x10
[ +0.000016] ? srso_return_thunk+0x5/0x5f
[ +0.000011] ? __kasan_check_write+0x14/0x20
[ +0.000010] ? srso_return_thunk+0x5/0x5f
[ +0.000011] ? _raw_spin_lock_irqsave+0x99/0x100
[ +0.000015] ? __pfx__raw_spin_lock_irqsave+0x10/0x10
[ +0.000014] ? srso_return_thunk+0x5/0x5f
[ +0.000013] ? srso_return_thunk+0x5/0x5f
[ +0.000011] ? srso_return_thunk+0x5/0x5f
[ +0.000011] ? preempt_count_sub+0x18/0xc0
[ +0.000013] ? srso_return_thunk+0x5/0x5f
[ +0.000010] ? _raw_spin_unlock_irqrestore+0x27/0x50
[ +0.000019] amdgpu_drm_ioctl+0x7e/0xe0 [amdgpu]
[ +0.004272] __x64_sys_ioctl+0xcd/0x110
[ +0.000020] do_syscall_64+0x5f/0xe0
[ +0.000021] entry_SYSCALL_64_after_hwframe+0x6e/0x76
[ +0.000015] RIP: 0033:0x7ff9ed31a94f
[ +0.000012] Code: 00 48 89 44 24 18 31 c0 48 8d 44 24 60 c7 04 24 10 00 00 00 48 89 44 24 08 48 8d 44 24 20 48 89 44 24 10 b8 10 00 00 00 0f 05 <41> 89 c0 3d 00 f0 ff ff 77 1f 48 8b 44 24 18 64 48 2b 04 25 28 00
[ +0.000013] RSP: 002b:00007fff25f66790 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
[ +0.000016] RAX: ffffffffffffffda RBX: 000055b3f7e133e0 RCX: 00007ff9ed31a94f
[ +0.000012] RDX: 000055b3f7e133e0 RSI: 00000000c1186451 RDI: 0000000000000003
[ +0.000010] RBP: 00000000c1186451 R08: 0000000000000000 R09: 0000000000000000
[ +0.000009] R10: 0000000000000008 R11: 0000000000000246 R12: 00007fff25f66ca8
[ +0.000009] R13: 0000000000000003 R14: 000055b3f7021ba8 R15: 00007ff9ed7af040
[ +0.000024] </TASK>
[ +0.000007] ---[ end trace 0000000000000000 ]---
v2: Consolidate any error handling into amdgpu_hmm_register
which applied to kfd_bo also. (Christian)
v3: Improve syntax and comment (Christian)
Cc: Christian Koenig <christian.koenig@amd.com >
Cc: Alex Deucher <alexander.deucher@amd.com >
Cc: Felix Kuehling <felix.kuehling@amd.com >
Cc: Joonkyo Jung <joonkyoj@yonsei.ac.kr >
Cc: Dokyung Song <dokyungs@yonsei.ac.kr >
Cc: <jisoo.jang@yonsei.ac.kr >
Cc: <yw9865@yonsei.ac.kr >
Signed-off-by: Vitaly Prosyak <vitaly.prosyak@amd.com >
Reviewed-by: Christian König <christian.koenig@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2024-03-20 13:12:56 -04:00
Mukul Joshi
71b9d19220
drm/amdgpu: Handle duplicate BOs during process restore
...
In certain situations, some apps can import a BO multiple times
(through IPC for example). To restore such processes successfully,
we need to tell drm to ignore duplicate BOs.
While at it, also add additional logging to prevent silent failures
when process restore fails.
Signed-off-by: Mukul Joshi <mukul.joshi@amd.com >
Reviewed-by: Felix Kuehling <felix.kuehling@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2024-03-20 13:12:56 -04:00
Mario Limonciello
2f14c0c8ca
drm/amd/display: Use freesync when DRM_EDID_FEATURE_CONTINUOUS_FREQ found
...
The monitor shipped with the Framework 16 supports VRR [1], but it's not
being advertised.
This is because the detailed timing block doesn't contain
`EDID_DETAIL_MONITOR_RANGE` which amdgpu looks for to find min and max
frequencies. This check however is superfluous for this case because
update_display_info() calls drm_get_monitor_range() to get these ranges
already.
So if the `DRM_EDID_FEATURE_CONTINUOUS_FREQ` EDID feature is found then
turn on freesync without extra checks.
v2: squash in fix from Harry
Closes: https://www.reddit.com/r/framework/comments/1b4y2i5/no_variable_refresh_rate_on_the_framework_16_on/
Closes: https://www.reddit.com/r/framework/comments/1b6vzcy/framework_16_variable_refresh_rate/
Closes: https://community.frame.work/t/resolved-no-vrr-freesync-with-amd-version/42338
Link: https://gist.github.com/superm1/e8fbacfa4d0f53150231d3a3e0a13faf
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com >
Reviewed-by: Harry Wentland <harry.wentland@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2024-03-20 13:12:56 -04:00
Dave Airlie
5d4e8ae6e5
nouveau/gsp: don't check devinit disable on GSP.
...
GSP should be handling this and I can see no evidence in opengpu
driver that this register should be touched.
Fixed acceleration on 2080 Ti GPUs.
Fixes: 15740541e8 ("drm/nouveau/devinit/tu102-: prepare for GSP-RM")
Signed-off-by: Dave Airlie <airlied@redhat.com >
Signed-off-by: Danilo Krummrich <dakr@redhat.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20240314014521.2695233-1-airlied@gmail.com
2024-03-19 14:34:55 +01:00
Dave Airlie
02ac437111
Merge tag 'drm-misc-next-fixes-2024-03-14' of https://gitlab.freedesktop.org/drm/misc/kernel into drm-next
...
Short summary of fixes pull:
probe-helper:
- never return negative values from .get_modes() plus driver fixes
nouveau:
- clear bo resource bus after eviction
- documentation fixes
Signed-off-by: Dave Airlie <airlied@redhat.com >
From: Thomas Zimmermann <tzimmermann@suse.de >
Link: https://patchwork.freedesktop.org/patch/msgid/20240314082833.GA8761@localhost.localdomain
2024-03-19 14:36:15 +10:00
Dave Airlie
341f708158
Merge tag 'drm-xe-next-fixes-2024-03-14' of https://gitlab.freedesktop.org/drm/xe/kernel into drm-next
...
Driver changes:
- Invalidate userptr VMA on page pin fault, allowing userspace
to free userptr while still having bindings
- Fail early on sysfs file creation error
- Skip VMA pinning on xe_exec with num_batch_buffer == 0
Signed-off-by: Dave Airlie <airlied@redhat.com >
From: Lucas De Marchi <lucas.demarchi@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/c4epi2j6anpc77z73zbgibxg7bxsmmkb522aa7tyei6oa6uunn@3oad4cgomd5a
2024-03-19 12:16:13 +10:00