]> Git Repo - linux.git/log
linux.git
2 years agodrm/amdgpu: add gang submit frontend v6
Christian König [Wed, 2 Mar 2022 15:39:34 +0000 (16:39 +0100)]
drm/amdgpu: add gang submit frontend v6

Allows submitting jobs as gang which needs to run on multiple engines at the
same time.

All members of the gang get the same implicit, explicit and VM dependencies. So
no gang member will start running until everything else is ready.

The last job is considered the gang leader (usually a submission to the GFX
ring) and used for signaling output dependencies.

Each job is remembered individually as user of a buffer object, so there is no
joining of work at the end.

v2: rebase and fix review comments from Andrey and Yogesh
v3: use READ instead of BOOKKEEP for now because of VM unmaps, set gang
    leader only when necessary
v4: fix order of pushing jobs and adding fences found by Trigger.
v5: fix job index calculation and adding IBs to jobs
v6: fix typo found by Alex

Signed-off-by: Christian König <[email protected]>
Reviewed-by: Alex Deucher <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
2 years agodrm/amdgpu: add gang submit backend v2
Christian König [Wed, 2 Mar 2022 15:26:53 +0000 (16:26 +0100)]
drm/amdgpu: add gang submit backend v2

Allows submitting jobs as gang which needs to run on multiple
engines at the same time.

Basic idea is that we have a global gang submit fence representing when the
gang leader is finally pushed to run on the hardware last.

Jobs submitted as gang are never re-submitted in case of a GPU reset since this
won't work and will just deadlock the hardware immediately again.

v2: fix logic inversion, improve documentation, fix rcu

Signed-off-by: Christian König <[email protected]>
Reviewed-by: Alex Deucher <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
2 years agodrm/amdgpu: cleanup instance limit on VCN4 v4
Christian König [Thu, 21 Jul 2022 09:52:35 +0000 (11:52 +0200)]
drm/amdgpu: cleanup instance limit on VCN4 v4

Similar to what we did for VCN3 use the job instead of the parser
entity. Cleanup the coding style quite a bit as well.

v2: merge improved application check into this patch
v3: finally fix the check
v4: limit to the correct engine

Signed-off-by: Christian König <[email protected]>
Reviewed-by: Alex Deucher <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
2 years agodrm/amdgpu: getting fan speed pwm for vega10 properly
Yury Zhuravlev [Sun, 18 Sep 2022 07:23:15 +0000 (16:23 +0900)]
drm/amdgpu: getting fan speed pwm for vega10 properly

Instead of using RPM speed, we will use a function from vega20 based on PWM registers.

Reviewed-by: Evan Quan <[email protected]>
Signed-off-by: Yury Zhuravlev <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
2 years agodrm: bridge/dw-hdmi-ahb-audio: use strscpy() is more robust and safer
Minghao Chi [Mon, 19 Sep 2022 03:04:01 +0000 (03:04 +0000)]
drm: bridge/dw-hdmi-ahb-audio: use strscpy() is more robust and safer

The implementation of strscpy() is more robust and safer.

That's now the recommended way to copy NUL terminated strings.

Reported-by: Zeal Robot <[email protected]>
Signed-off-by: Minghao Chi <[email protected]>
Reviewed-by: Neil Armstrong <[email protected]>
Signed-off-by: Neil Armstrong <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2 years agodrm/ast: Fix video broken in some resolutions on ast2600
Jammy Huang [Fri, 16 Sep 2022 09:17:06 +0000 (17:17 +0800)]
drm/ast: Fix video broken in some resolutions on ast2600

Some cases are not handled well for ast2600.

Signed-off-by: Jammy Huang <[email protected]>
Signed-off-by: Thomas Zimmermann <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2 years agodrm/ast: Add resolution support for 1152x864@75
Jammy Huang [Fri, 16 Sep 2022 08:50:58 +0000 (16:50 +0800)]
drm/ast: Add resolution support for 1152x864@75

Add 1152x864 into support list.

Signed-off-by: Jammy Huang <[email protected]>
Signed-off-by: Thomas Zimmermann <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2 years agodrm/plane-helper: Provide DRM_PLANE_NON_ATOMIC_FUNCS initializer macro
Thomas Zimmermann [Fri, 9 Sep 2022 10:59:47 +0000 (12:59 +0200)]
drm/plane-helper: Provide DRM_PLANE_NON_ATOMIC_FUNCS initializer macro

Provide DRM_PLANE_NON_ATOMIC_FUNCS, which initializes plane functions
of non-atomic drivers to default values. The macro is not supposed to
be used in new code, but helps with documenting and finding existing
users.

Signed-off-by: Thomas Zimmermann <[email protected]>
Reviewed-by: Javier Martinez Canillas <[email protected]>
Reviewed-by: Laurent Pinchart <[email protected]>
Reviewed-by: Lyude Paul <[email protected]> # nouveau
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2 years agodrm/plane-helper: Warn if atomic drivers call non-atomic helpers
Thomas Zimmermann [Fri, 9 Sep 2022 10:59:46 +0000 (12:59 +0200)]
drm/plane-helper: Warn if atomic drivers call non-atomic helpers

The plane update and disable helpers are only useful for non-atomic
drivers. Print a warning if an atomic driver calls them.

Suggested-by: Daniel Vetter <[email protected]>
Signed-off-by: Thomas Zimmermann <[email protected]>
Reviewed-by: Javier Martinez Canillas <[email protected]>
Reviewed-by: Laurent Pinchart <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2 years agodrm/plane: Allocate planes with drm_universal_plane_alloc()
Thomas Zimmermann [Fri, 9 Sep 2022 10:59:45 +0000 (12:59 +0200)]
drm/plane: Allocate planes with drm_universal_plane_alloc()

Provide drm_univeral_plane_alloc() to allocate and initialize a
plane. Code for non-atomic drivers uses this pattern. Convert them to
the new function. The modeset helpers contain a quirk for handling their
color formats differently. Set the flag outside plane allocation.

The new function is already deprecated to some extend. Drivers should
rather use drmm_univeral_plane_alloc() or drm_universal_plane_init().

v2:
* kerneldoc fixes (Javier)
* grammar fixes in commit message

Signed-off-by: Thomas Zimmermann <[email protected]>
Reviewed-by: Javier Martinez Canillas <[email protected]>
Reviewed-by: Lyude Paul <[email protected]> # nouveau
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2 years agodrm/plane: Remove drm_plane_init()
Thomas Zimmermann [Fri, 9 Sep 2022 10:59:44 +0000 (12:59 +0200)]
drm/plane: Remove drm_plane_init()

Open-code drm_plane_init() and remove the function from DRM. The
implementation of drm_plane_init() is a simple wrapper around a call
to drm_universal_plane_init(), so drivers can just use that instead.

Signed-off-by: Thomas Zimmermann <[email protected]>
Reviewed-by: Javier Martinez Canillas <[email protected]>
Reviewed-by: Laurent Pinchart <[email protected]>
Reviewed-by: Lyude Paul <[email protected]> # nouveau
Acked-by: Jyri Sarha <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2 years agodrm/atomic-helper: Fix kernel-doc
Jiapeng Chong [Mon, 19 Sep 2022 10:30:58 +0000 (18:30 +0800)]
drm/atomic-helper: Fix kernel-doc

drivers/gpu/drm/drm_atomic_helper.c:802: warning: expecting prototype for drm_atomic_helper_check_wb_connector_state(). Prototype was for drm_atomic_helper_check_wb_encoder_state() instead.

Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=2216
Reported-by: Abaci Robot <[email protected]>
Signed-off-by: Jiapeng Chong <[email protected]>
Signed-off-by: Thomas Zimmermann <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2 years agodrm/amdgpu: revert "fix limiting AV1 to the first instance on VCN3" v3
Christian König [Wed, 13 Jul 2022 16:22:18 +0000 (18:22 +0200)]
drm/amdgpu: revert "fix limiting AV1 to the first instance on VCN3" v3

This reverts commit 250195ff744f260c169f5427422b6f39c58cb883.

The job should now be initialized when we reach the parser functions.

v2: merge improved application check into this patch
v3: back to the original test, but use the right ring

Signed-off-by: Christian König <[email protected]>
Reviewed-by: Alex Deucher <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
2 years agodrm/amdgpu: move entity selection and job init earlier during CS
Christian König [Mon, 5 Sep 2022 07:22:29 +0000 (09:22 +0200)]
drm/amdgpu: move entity selection and job init earlier during CS

Initialize the entity for the CS and scheduler job much earlier.

v2: fix job initialisation order and use correct scheduler instance

Signed-off-by: Christian König <[email protected]>
Reviewed-by: Alex Deucher <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
2 years agodrm/amdgpu: cleanup error handling in amdgpu_cs_parser_bos
Christian König [Tue, 13 Sep 2022 07:52:13 +0000 (09:52 +0200)]
drm/amdgpu: cleanup error handling in amdgpu_cs_parser_bos

Return early on success and so remove all those "if (r)" in the error
path.

Signed-off-by: Christian König <[email protected]>
Reviewed-by: Alex Deucher <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
2 years agodrm/amdgpu: cleanup CS pass2 v6
Christian König [Thu, 24 Feb 2022 09:22:16 +0000 (10:22 +0100)]
drm/amdgpu: cleanup CS pass2 v6

Cleanup the coding style and function names to represent the data
they process for pass2 as well.

Go over the chunks only twice now instead of multiple times.

v2: fix job initialisation order and use correct scheduler instance
v3: try to move all functional changes into a separate patch.
v4: separate reordering, pass1 and pass2 change
v5: fix va_start calculation
v6: fix user fence check

Signed-off-by: Christian König <[email protected]>
Reviewed-by: Alex Deucher <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
2 years agodrm/amd/pm: Remove redundant check condition
YiPeng Chai [Thu, 8 Sep 2022 01:48:11 +0000 (09:48 +0800)]
drm/amd/pm: Remove redundant check condition

V3:
[Why]:
  Since ASICs using smu v13_0_2 have called smu
.suspend before calling amdgpu_pm_sysfs_fini,
pm.dpm_enabled was already set to 0 when smu
.suspend was called. This makes it impossible
to delete all pm sys nodes.

[How]:
  Since all functions in amdgpu_pm_sysfs_fini
have their own condition checks, so the first
conditional check in amdgpu_pm_sysfs_fini can
be removed.

Signed-off-by: YiPeng Chai <[email protected]>
Reviewed-by: Hawking Zhang <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
2 years agodrm/amdgpu: Fixed psp fence and memory issues when removing amdgpu device
YiPeng Chai [Thu, 8 Sep 2022 01:44:36 +0000 (09:44 +0800)]
drm/amdgpu: Fixed psp fence and memory issues when removing amdgpu device

V3:
Fixed psp fence and memory issues for the asic
using smu v13_0_2 when removing amdgpu device.

[Why]:
1. psp_suspend->psp_free_shared_bufs->
       psp_ta_free_shared_buf->
           amdgpu_bo_free_kernel->
             ...->amdgpu_bo_release_notify->
                    amdgpu_fill_buffer
   psp will free vram memory used by psp when psp_suspend
   is called. But for the asic using smu v13_0_2, because
   psp_suspend is called before adev->shutdown is set to
   true when removing the first hive device, amdgpu fill_buffer
   will be called, which will cause fence issues when evicting
   all vram resources in amdgpu vram mgr_fini.
2. Since psp_hw_fini is not called after calling psp_suspend
   and psp_suspend only calls psp_ring_stop, the psp ring memory
   will not be released when amdgpu device is removed.

[How]:
1. Set shutdown to true before calling amdgpu_device_gpu_recover,
   then amdgpu_fill_buffer will not be called when psp_suspend is
   called.
2. Free psp ring memory in psp_sw_fini.

Signed-off-by: YiPeng Chai <[email protected]>
Reviewed-by: Hawking Zhang <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
2 years agodrm/amdgpu: Adjust removal control flow for smu v13_0_2
YiPeng Chai [Wed, 7 Sep 2022 08:07:42 +0000 (16:07 +0800)]
drm/amdgpu: Adjust removal control flow for smu v13_0_2

Adjust removal control flow for smu v13_0_2:
   During amdgpu uninstallation, when removing the first
device, the kernel needs to first send a mode1reset message
to all gpu devices. Otherwise, smu initialization will fail
the next time amdgpu is installed.

V2:
1. Update commit comments.
2. Remove the global variable amdgpu_device_remove_cnt
   and add a variable to the structure amdgpu_hive_info.
3. Use hive to detect the first removed device instead of
   a global variable.

V3:
 1. Update commit comments.
 2. Split a patch into multiple patches.
 3. The current patch does:
    a. Add a work mode of AMDGPU_RESET_FOR_DEVICE_REMOVE into
       the existing gpu recover path, which make all devices
       in hive list only have HW reset but no resume (except
       the base IP).
    b. Call AMDGPU_RESET_FOR_DEVICE_REMOVE and
       AMDGPU_NEED_FULL_RESET mode of amdgpu_device_gpu_recover
       in amdgpu_pci_remove when removing the first device in
       hive list.
    c. When removing the first device, the IP blocks keyword
       function call sequence is as follows:
.suspend->mode1reset->.resume(basic ip)->.hw_fini->.early_fini->.sw_fini.
   ^                           |
   |-<----------<---------<----|
The first three sequences are because of a call to
        amdgpu_device_gpu_recover. The three sequences will be
        executed in a loop until all devices in the hive list
        are iterated.
        The sequences starting from .hw_fini only apply to the
        first device. Since .suspend has been called before,
        except the resumed phase1 basic ip blocks, all other ip
        blocks .hw_fini of current device will do nothing.
     d. When removing other devices, the calling sequences is the
        same as legacy:
   .hw_fini -> .early_fini -> .sw_fini.
Since .suspend has been called when removing the first device,
        except the resumed phase1 basic ip blocks, all of other ip
        blocks .hw_fini of current device will do nothing.

Signed-off-by: YiPeng Chai <[email protected]>
Reviewed-by: Hawking Zhang <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
2 years agodrm/amd/display: 3.2.204
Aric Cyr [Mon, 12 Sep 2022 03:59:13 +0000 (23:59 -0400)]
drm/amd/display: 3.2.204

This version brings along following fixes:
- Fix urgent latency override for DCN32/DCN321
- Correct hostvm flag in DCN31
- Added new Asic Id for DCN301
- Adjust to 2 phys in DCN301
- Update dummy P-state search to use DCN32 DML
- Increase dcn315 pstate change latency
- Disable OTG WA for the plane_state NULL case on DCN314
- Update dccg based on HW delta
- Correct num_dsc for DCN314
- Fix DP DSC compliance failure with DCN314
- Refactor edp power sequencer codes
- update gamut remap if plane has changed
- Skip audio setup when audio stream is enabled
- Display distortion after hotplug LG Ultrafine 5K tiled display
- Fix DP MST timeslot issue when fallback happened
- Uncomment SubVP pipe split assignment in driver
- Enable committing subvp config
- Do second pass through DML for DET calculation
- Don't allocate DET for phantom pipes
- Modify DML to adjust Vstartup Position
- Ignore k1/k2 values for virtual signal to avoid assert
- Fix failures of disabling primary planes
- Do not compare integers of different widths
- Fix empty slot problem of EDID management
- Revise Sink device string ID width in dmub psr
- Log vertical interrupt 1 for debug

Acked-by: Wayne Lin <[email protected]>
Signed-off-by: Aric Cyr <[email protected]>
Tested-by: Daniel Wheeler <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
2 years agodrm/amd/display: correct num_dsc based on HW cap
Charlene Liu [Sat, 10 Sep 2022 19:08:51 +0000 (15:08 -0400)]
drm/amd/display: correct num_dsc based on HW cap

[why]
num_dsc is 3 for dcn314 based on HW capablity.

Reviewed-by: Martin Leung <[email protected]>
Acked-by: Wayne Lin <[email protected]>
Signed-off-by: Charlene Liu <[email protected]>
Tested-by: Daniel Wheeler <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
2 years agodrm/amd/display: solve regression in update phy state refactor
Wenjing Liu [Fri, 9 Sep 2022 16:19:52 +0000 (12:19 -0400)]
drm/amd/display: solve regression in update phy state refactor

[Why]
There is a coding error when moving dp disable link phy to
hw sequencer, where the receiver power control is missed during
this refactor.

[how]
1. Add back missing receiver power control in disable link phy.
2. minor modifications to ensure there is no undesired sequence
changes in dp link enable/disable.

Reviewed-by: Charlene Liu <[email protected]>
Reviewed-by: Martin Leung <[email protected]>
Acked-by: Wayne Lin <[email protected]>
Signed-off-by: Wenjing Liu <[email protected]>
Tested-by: Daniel Wheeler <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
2 years agodrm/amd/display: update dccg based on HW delta
Charlene Liu [Fri, 9 Sep 2022 01:12:45 +0000 (21:12 -0400)]
drm/amd/display: update dccg based on HW delta

[why]
update hw dccg based on HW delta, and reuse common src code

Reviewed-by: Nicholas Kazlauskas <[email protected]>
Reviewed-by: Dmytro Laktyushkin <[email protected]>
Acked-by: Wayne Lin <[email protected]>
Signed-off-by: Charlene Liu <[email protected]>
Tested-by: Daniel Wheeler <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
2 years agodrm/amd/display: Do second pass through DML for DET calculation
Alvin Lee [Fri, 9 Sep 2022 20:09:57 +0000 (16:09 -0400)]
drm/amd/display: Do second pass through DML for DET calculation

[Why & How]
If we find that DML requires pipe split, run through
DML again because the DET allocation per pipe must
be re-assigned.

Reviewed-by: Dmytro Laktyushkin <[email protected]>
Acked-by: Wayne Lin <[email protected]>
Signed-off-by: Alvin Lee <[email protected]>
Tested-by: Daniel Wheeler <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
2 years agodrm/amd/display: log vertical interrupt 1 for debug
Josip Pavic [Fri, 9 Sep 2022 18:18:31 +0000 (14:18 -0400)]
drm/amd/display: log vertical interrupt 1 for debug

[Why & How]
Extend existing OTG state collection function to include the vertical
interrupt 1 state.

Reviewed-by: Aric Cyr <[email protected]>
Acked-by: Wayne Lin <[email protected]>
Signed-off-by: Josip Pavic <[email protected]>
Tested-by: Daniel Wheeler <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
2 years agodrm/amd/display: Revise Sink device string ID
Robin Chen [Thu, 8 Sep 2022 13:42:10 +0000 (21:42 +0800)]
drm/amd/display: Revise Sink device string ID

[Why]
The Sink device string ID1/ID2 use 5 bytes instead of 6 bytes,
so the driver should compare the first 5 bytes only.

Reviewed-by: Anthony Koo <[email protected]>
Acked-by: Wayne Lin <[email protected]>
Signed-off-by: Robin Chen <[email protected]>
Tested-by: Daniel Wheeler <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
2 years agodrm/amd/display: Modify DML to adjust Vstartup Position
muansari [Thu, 1 Sep 2022 17:21:52 +0000 (13:21 -0400)]
drm/amd/display: Modify DML to adjust Vstartup Position

[WHY]
The Vstartup position should be as late as possible to
maximize power saving with the current. Calculation of
Vstartup in DML does not take into account as SDP signal.

[HOW]
Made necessary changes to calculate the correct Vstartup
position in DML to account for AS SDP
* Overriding the VBlankNom value in certain cases
  otherwise it will use the default value
* Bypassing the condition for adjust_sync_Vstartup
* Overriding vblank_nom_input with VBlankNom that is
  set in the SW Layer

Reviewed-by: Anthony Koo <[email protected]>
Acked-by: Wayne Lin <[email protected]>
Signed-off-by: muansari <[email protected]>
Tested-by: Daniel Wheeler <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
2 years agodrm/amd/display: Disable OTG WA for the plane_state NULL case on DCN314
Nicholas Kazlauskas [Tue, 6 Sep 2022 13:47:24 +0000 (09:47 -0400)]
drm/amd/display: Disable OTG WA for the plane_state NULL case on DCN314

[Why]
This shouldn't trigger during tiled display hotplug/unplug but it does
because one of the tiles can end up with a NULL plane state.

This also doesn't guard against the hang that it was originally trying
to resolve, and can instead cause DIO corruption due to OTG sync
being lost.

[How]
This was reverted at one point out of DCN31 so revert it here too.

Reviewed-by: Dmytro Laktyushkin <[email protected]>
Acked-by: Wayne Lin <[email protected]>
Signed-off-by: Nicholas Kazlauskas <[email protected]>
Tested-by: Daniel Wheeler <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
2 years agodrm/amd/display: Add shift and mask for ICH_RESET_AT_END_OF_LINE
Daniel Miess [Fri, 9 Sep 2022 15:32:55 +0000 (11:32 -0400)]
drm/amd/display: Add shift and mask for ICH_RESET_AT_END_OF_LINE

[Why]
DP DSC compliance failing for dcn314 due to ICH_RESET_AT_END_OF_LINE
shift and mask being missing

[How]
Add in shift and mask for ICH_RESET_AT_END_OF_LINE

Reviewed-by: Nicholas Kazlauskas <[email protected]>
Acked-by: Wayne Lin <[email protected]>
Signed-off-by: Daniel Miess <[email protected]>
Tested-by: Daniel Wheeler <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
2 years agodrm/amd/display: Enable committing subvp config
Aurabindo Pillai [Thu, 8 Sep 2022 15:11:50 +0000 (11:11 -0400)]
drm/amd/display: Enable committing subvp config

[Why and How]
Enable committing subvp config through DMCUB for DCN32

Reviewed-by: Alvin Lee <[email protected]>
Acked-by: Wayne Lin <[email protected]>
Signed-off-by: Aurabindo Pillai <[email protected]>
Tested-by: Daniel Wheeler <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
2 years agodrm/amd/display: Assume connectors are on single slot
Jaehyun Chung [Thu, 8 Sep 2022 23:11:31 +0000 (19:11 -0400)]
drm/amd/display: Assume connectors are on single slot

[Why]
v1_5 display object table has no way for connectors to
indicate which slot they are a part of, resulting in additional
empty slots to appear in EDID management UI.

[How]
Assume that all connectors belong to the same slot.

Reviewed-by: Jun Lei <[email protected]>
Acked-by: Wayne Lin <[email protected]>
Signed-off-by: Jaehyun Chung <[email protected]>
Tested-by: Daniel Wheeler <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
2 years agodrm/amd/display: do not compare integers of different widths
Josip Pavic [Thu, 8 Sep 2022 16:01:41 +0000 (12:01 -0400)]
drm/amd/display: do not compare integers of different widths

[Why & How]
Increase width of some variables to avoid comparing integers of
different widths

Reviewed-by: Alvin Lee <[email protected]>
Acked-by: Wayne Lin <[email protected]>
Signed-off-by: Josip Pavic <[email protected]>
Tested-by: Daniel Wheeler <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
2 years agodrm/amd/display: increase dcn315 pstate change latency
Dmytro Laktyushkin [Wed, 27 Jul 2022 17:02:44 +0000 (13:02 -0400)]
drm/amd/display: increase dcn315 pstate change latency

[Why & How]
Update after new measurment came in

Reviewed-by: Jun Lei <[email protected]>
Acked-by: Wayne Lin <[email protected]>
Signed-off-by: Dmytro Laktyushkin <[email protected]>
Tested-by: Daniel Wheeler <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
2 years agodrm/amd/display: Ignore k1/k2 values for virtual signal
Rodrigo Siqueira [Tue, 6 Sep 2022 20:36:41 +0000 (16:36 -0400)]
drm/amd/display: Ignore k1/k2 values for virtual signal

[Why and How]
We are hitting k1/k2 assert when we are using a virtual signal in the
test; as a result, we are failing some automated tests with a false
positive. This commit addresses this issue by ignoring the assert
condition if we use SIGNAL_TYPE_VIRTUAL.

Reviewed-by: Aurabindo Pillai <[email protected]>
Acked-by: Wayne Lin <[email protected]>
Signed-off-by: Rodrigo Siqueira <[email protected]>
Tested-by: Daniel Wheeler <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
2 years agodrm/amd/display: Don't allocate DET for phantom pipes
Alvin Lee [Thu, 8 Sep 2022 15:08:25 +0000 (11:08 -0400)]
drm/amd/display: Don't allocate DET for phantom pipes

[Why & How]
We should not allocate any DET for the phantom pipes.

Reviewed-by: Jun Lei <[email protected]>
Acked-by: Wayne Lin <[email protected]>
Signed-off-by: Alvin Lee <[email protected]>
Tested-by: Daniel Wheeler <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
2 years agodrm/amd/display: Fix DP MST timeslot issue when fallback happened
Cruise Hung [Thu, 8 Sep 2022 14:04:09 +0000 (22:04 +0800)]
drm/amd/display: Fix DP MST timeslot issue when fallback happened

[Why]
When USB4 DP link training failed and fell back to lower link rate,
the time slot calculation uses the verified_link_cap.
And the verified_link_cap was not updated to the new one.
It caused the wrong VC payload time-slot was allocated.

[How]
Updated verified_link_cap with the new one from cur_link_settings
after the LT completes successfully.

Reviewed-by: Jun Lei <[email protected]>
Acked-by: Wayne Lin <[email protected]>
Signed-off-by: Cruise Hung <[email protected]>
Tested-by: Daniel Wheeler <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
2 years agodrm/amd/display: Display distortion after hotplug 5K tiled display
Meenakshikumar Somasundaram [Wed, 31 Aug 2022 17:27:07 +0000 (13:27 -0400)]
drm/amd/display: Display distortion after hotplug 5K tiled display

[Why]
During hot plug of specific 5K tiled display, sometimes both the tiles
are not synchronized resulting in distortion. The reason is that otgs of
both the tiles goes out of sync when otg workaround (dcnxxx_disable_otg_wa)
is applied for bandwidth optimization. The otg workaround reenables otg
but otg synchronization context is not reset and hence dc_trigger_sync()
does not resynchronize otg again.

[How]
Implement reset_sync_context_for_pipe() to reset the otg synchronization
context for the disabled pipe and its slave pipes when otg workaround is
applied.

Reviewed-by: Nicholas Kazlauskas <[email protected]>
Acked-by: Wayne Lin <[email protected]>
Signed-off-by: Meenakshikumar Somasundaram <[email protected]>
Tested-by: Daniel Wheeler <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
2 years agodrm/amd/display: Update dummy P-state search to use DCN32 DML
George Shen [Thu, 1 Sep 2022 22:30:37 +0000 (18:30 -0400)]
drm/amd/display: Update dummy P-state search to use DCN32 DML

[Why]
Current DCN3.2 logic for finding the dummy P-state index uses the
DCN3.0 DML validation function instead of DCN3.2 DML.

This can result in either unexpected DML VBA values, or unexpected
dummy P-state index to be used.

[How]
Update the dummy P-state logic to use DCN3.2 DML validation function.

Reviewed-by: Alvin Lee <[email protected]>
Reviewed-by: Nevenko Stupar <[email protected]>
Acked-by: Wayne Lin <[email protected]>
Signed-off-by: George Shen <[email protected]>
Tested-by: Daniel Wheeler <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
2 years agodrm/amd/display: Expose few dchubbub functions
Charlene Liu [Wed, 7 Sep 2022 18:49:41 +0000 (14:49 -0400)]
drm/amd/display: Expose few dchubbub functions

[why]
Expose few dchubbun functions in dcn31 and dcn32 to leverage.

Reviewed-by: Dmytro Laktyushkin <[email protected]>
Acked-by: Wayne Lin <[email protected]>
Signed-off-by: Charlene Liu <[email protected]>
Tested-by: Daniel Wheeler <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
2 years agodrm/amd/display: Removing 2 phys
Pavle Kotarac [Thu, 1 Sep 2022 19:24:09 +0000 (15:24 -0400)]
drm/amd/display: Removing 2 phys

[WHY]
New dcn301 has 2 less phys

Reviewed-by: Charlene Liu <[email protected]>
Acked-by: Wayne Lin <[email protected]>
Signed-off-by: Pavle Kotarac <[email protected]>
Tested-by: Daniel Wheeler <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
2 years agodrm/amd/display: Added new DCN301 Asic Id
Pavle Kotarac [Thu, 1 Sep 2022 19:15:37 +0000 (15:15 -0400)]
drm/amd/display: Added new DCN301 Asic Id

[WHY]
Adding new asic id for dcn301

Reviewed-by: Charlene Liu <[email protected]>
Acked-by: Wayne Lin <[email protected]>
Signed-off-by: Pavle Kotarac <[email protected]>
Tested-by: Daniel Wheeler <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
2 years agodrm/amd/display: correct hostvm flag
Sherry Wang [Tue, 6 Sep 2022 16:12:44 +0000 (00:12 +0800)]
drm/amd/display: correct hostvm flag

[Why]
Hostvm should be enabled/disabled accordding to
the status of riommu_active, but hostvm always
be disabled on DCN31 which causes underflow

[How]
Set correct hostvm flag on DCN31

Reviewed-by: Charlene Liu <[email protected]>
Acked-by: Wayne Lin <[email protected]>
Signed-off-by: Sherry Wang <[email protected]>
Tested-by: Daniel Wheeler <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
2 years agodrm/amd/display: Fix urgent latency override for DCN32/DCN321
George Shen [Thu, 1 Sep 2022 19:03:50 +0000 (15:03 -0400)]
drm/amd/display: Fix urgent latency override for DCN32/DCN321

[Why]
The urgent latency override is useful when debugging issues
relating to underflow.

Current overridden variable is not correct and has no effect
on DCN3.2 and DCN3.21 DML calculations.

[How]
For DCN3.2 and DCN3.21, override the correct urgent latency
variable when bounding box override is present.

Reviewed-by: Alvin Lee <[email protected]>
Reviewed-by: Nevenko Stupar <[email protected]>
Acked-by: Wayne Lin <[email protected]>
Signed-off-by: George Shen <[email protected]>
Tested-by: Daniel Wheeler <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
2 years agodrm/amd/display: Uncomment SubVP pipe split assignment in driver
Alvin Lee [Tue, 6 Sep 2022 23:25:13 +0000 (19:25 -0400)]
drm/amd/display: Uncomment SubVP pipe split assignment in driver

[Why & How]
Uncomment SubVP pipe split assignment in driver since FW headers
are now promoted

Reviewed-by: Martin Leung <[email protected]>
Acked-by: Wayne Lin <[email protected]>
Signed-off-by: Alvin Lee <[email protected]>
Tested-by: Daniel Wheeler <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
2 years agodrm/amd/display: skip audio setup when audio stream is enabled
zhikzhai [Fri, 26 Aug 2022 11:44:50 +0000 (19:44 +0800)]
drm/amd/display: skip audio setup when audio stream is enabled

[why]
We have minimal pipe split transition method to avoid pipe
allocation outage.However, this method will invoke audio setup
which cause audio output stuck once pipe reallocate.

[how]
skip audio setup for pipelines which audio stream has been enabled

Reviewed-by: Charlene Liu <[email protected]>
Acked-by: Wayne Lin <[email protected]>
Signed-off-by: zhikzhai <[email protected]>
Tested-by: Daniel Wheeler <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
2 years agodrm/amd/display: update gamut remap if plane has changed
Hugo Hu [Thu, 1 Sep 2022 02:08:35 +0000 (10:08 +0800)]
drm/amd/display: update gamut remap if plane has changed

[Why]
The desktop plane and full-screen game plane may have different
gamut remap coefficients, if switching between desktop and
full-screen game without updating the gamut remap will cause
incorrect color.

[How]
Update gamut remap if planes change.

Reviewed-by: Dmytro Laktyushkin <[email protected]>
Acked-by: Wayne Lin <[email protected]>
Signed-off-by: Hugo Hu <[email protected]>
Tested-by: Daniel Wheeler <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
2 years agodrm/amd/display: Refactor edp panel power sequencer(PPS) codes
Ian Chen [Tue, 30 Aug 2022 06:50:24 +0000 (14:50 +0800)]
drm/amd/display: Refactor edp panel power sequencer(PPS) codes

[Why & How]
Move extra panel power sequencer settings into panel_cofig struct.

Reviewed-by: Anthony Koo <[email protected]>
Acked-by: Wayne Lin <[email protected]>
Signed-off-by: Ian Chen <[email protected]>
Tested-by: Daniel Wheeler <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
2 years agodrm/amd/display: 3.2.203
Aric Cyr [Mon, 5 Sep 2022 02:02:04 +0000 (22:02 -0400)]
drm/amd/display: 3.2.203

This version brings along following fixes:
- Port DCN30 420 logic to DCN32
- Remove some unused definitions from DCN32/321
- Remove dp dig pixle rate div policy from dcn314
- Fix dcn315 reading of memory channel count and width

- Fix SubVP and ODM relevant issues
- Fix pipe split, MPO and ODM relevant issues
- Support proper mst payload removal when link is not in mst mode in dc
- Assume an LTTPR is always present on fixed_vs links
- Rework recent update PHY state commit
- Add debug option and logs

Acked-by: Wayne Lin <[email protected]>
Signed-off-by: Aric Cyr <[email protected]>
Tested-by: Daniel Wheeler <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
2 years agodrm/amd/display: [FW Promotion] Release 0.0.134.0
Anthony Koo [Sun, 4 Sep 2022 01:31:04 +0000 (21:31 -0400)]
drm/amd/display: [FW Promotion] Release 0.0.134.0

- Handle pipe split case for SubVP:
  Pass in pipe split index for main and phantom pipes

Reviewed-by: Aric Cyr <[email protected]>
Acked-by: Wayne Lin <[email protected]>
Signed-off-by: Anthony Koo <[email protected]>
Tested-by: Daniel Wheeler <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
2 years agodrm/amd/display: Fix SubVP way calculation
Alvin Lee [Fri, 2 Sep 2022 19:39:12 +0000 (15:39 -0400)]
drm/amd/display: Fix SubVP way calculation

[Why and How]
- Don't skip bottom and next odm pipe when calculating
  num ways for subvp
- Don't need to double cache lines for DCC (divide by 256)

Reviewed-by: Jun Lei <[email protected]>
Acked-by: Wayne Lin <[email protected]>
Signed-off-by: Alvin Lee <[email protected]>
Tested-by: Daniel Wheeler <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
2 years agodrm/amd/display: Disable SubVP on driver disable
Alvin Lee [Thu, 1 Sep 2022 23:03:31 +0000 (19:03 -0400)]
drm/amd/display: Disable SubVP on driver disable

[Why and How]
- For driver disable cases in current implementation, if P-State
  is unsupported or still supported by firmware, we force it
  supported by DCN.

- SubVP now needs to be included in this case along with FPO.

Reviewed-by: Jun Lei <[email protected]>
Acked-by: Wayne Lin <[email protected]>
Signed-off-by: Alvin Lee <[email protected]>
Tested-by: Daniel Wheeler <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
2 years agodrm/amd/display: SubVP pipe split case
Alvin Lee [Thu, 1 Sep 2022 22:54:22 +0000 (18:54 -0400)]
drm/amd/display: SubVP pipe split case

[Why and How]
For SubVP pipe split case, pass in split index for
main and phantom pipes to ensure that the P-State
sequence will force P-State for all required pipes.

Reviewed-by: Nevenko Stupar <[email protected]>
Reviewed-by: Jun Lei <[email protected]>
Acked-by: Wayne Lin <[email protected]>
Signed-off-by: Alvin Lee <[email protected]>
Tested-by: Daniel Wheeler <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
2 years agodrm/amd/display: Add debug option for allocating extra way for cursor
Alvin Lee [Thu, 1 Sep 2022 22:43:39 +0000 (18:43 -0400)]
drm/amd/display: Add debug option for allocating extra way for cursor

[Why and How]
- Add a debug option for allocating extra way for cursor
- Remove usage of cache_cursor_addr since it's not gaurenteed
  to be populated
- Include cursor size in MALL calculation if it exceeds the
  DCN cursor buffer size (and don't need extra way for cursor)

Reviewed-by: Aurabindo Pillai <[email protected]>
Acked-by: Wayne Lin <[email protected]>
Signed-off-by: Alvin Lee <[email protected]>
Tested-by: Daniel Wheeler <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
2 years agodrm/amd/display: For ODM seamless transition require AUTO mode
Alvin Lee [Thu, 1 Sep 2022 22:40:32 +0000 (18:40 -0400)]
drm/amd/display: For ODM seamless transition require AUTO mode

[Why & How]
ODM seamless transitions require DIV_MODE_AUTO. However,
DIV_MODE_AUTO only works when all the horizontal timing params
are divisible by the ODM combine factor. Therefore, disable the
ODM 2:1 policy when the horizontal timing params are not divisible
by 2.

Reviewed-by: Jun Lei <[email protected]>
Acked-by: Wayne Lin <[email protected]>
Signed-off-by: Alvin Lee <[email protected]>
Tested-by: Daniel Wheeler <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
2 years agodrm/amd/display: support proper mst payload removal when link is not in mst mode...
Wenjing Liu [Wed, 31 Aug 2022 19:22:56 +0000 (15:22 -0400)]
drm/amd/display: support proper mst payload removal when link is not in mst mode in dc

[why]
When user unplugs mst hubs, the current code will forcefully zero
entire mst payload allocation table structure stored in link before we
deallocate actual payload when disabling stream.

During the first disable stream sequence, we will use current mst
payload allocation table to determine if link should be turned off.
Because we zero out it before we are disabling stream, the payload
allocation table stored in link doesn't represent the actual allocation status,
so we turn off link at the first disable stream without waiting until all
streams' payloads have been deallocated. This avoilates the designed
deallocation sequence and caused system hang in DP2 scenario.

[how]
Remove payload during deallocation and never zero payload allocation structure
without actually deallocating payload.

Reviewed-by: Jun Lei <[email protected]>
Acked-by: Wayne Lin <[email protected]>
Signed-off-by: Wenjing Liu <[email protected]>
Tested-by: Daniel Wheeler <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
2 years agodrm/amd/display: rework recent update PHY state commit
Wenjing Liu [Wed, 31 Aug 2022 18:56:46 +0000 (14:56 -0400)]
drm/amd/display: rework recent update PHY state commit

[why]
Original change 594b237b9a07 ("drm/amd/display: Add
interface to track PHY state") was implemented by assuming stream's
dpms off is equivalent to PHY power off.
This assumption doesn't hold in following situations:
1. MST multiple stream scenario, where multiple streams are sharing the
same PHY output. Toggle dpms off for one of the stream doesn't power
off the PHY due to the presence of other streams.
2. enable stream failure scenario, where enable stream fails due to
failure of link training. This will cause DPMS off is set to false, while
the actual PHY power state is off in certain cases.
Due to the problematic assumption, the logic will skip disabling
other streams for MST multiple stream scenario, therefore PHY is
not actually powered off.

[how]
1. Rework this refactor by moving PHY state update down to hardware
level, where we update PHY state in place when hardware sequencer
is actually changing the power state of the PHY hardware.
2. Reimplement symclk on TX off workaround in place when we are actually
calling transmitter control to power off PHY in dcn32. Note the workaround is
added due to the lack of proper software interface to set TX while keeping
symclk on. We plan to address this interface problem so we can set TX off
only without affecting symclk in future dcn versions.

Fixes: 594b237b9a07 ("drm/amd/display: Add interface to track PHY state")
Reviewed-by: Jun Lei <[email protected]>
Acked-by: Wayne Lin <[email protected]>
Signed-off-by: Wenjing Liu <[email protected]>
Tested-by: Daniel Wheeler <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
2 years agodrm/amdgpu: add MES and MES-KIQ version in debugfs
Yifan Zhang [Thu, 15 Sep 2022 09:03:44 +0000 (17:03 +0800)]
drm/amdgpu: add MES and MES-KIQ version in debugfs

This patch addes MES and MES-KIQ version in debugfs.

Signed-off-by: Yifan Zhang <[email protected]>
Reviewed-by: Tim Huang <[email protected]>
Acked-by: Alex Deucher <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
2 years agodrm/amd/display: Assume an LTTPR is always present on fixed_vs links
Michael Strauss [Wed, 31 Aug 2022 19:10:43 +0000 (15:10 -0400)]
drm/amd/display: Assume an LTTPR is always present on fixed_vs links

[WHY]
LTTPRs can in very rare instsances fail to increment DPCD LTTPR count.
This results in aux-i LTTPR requests to be sent to the wrong DPCD
address, which causes link training failure.

[HOW]
Override internal repeater count if fixed_vs flag is set for a given link

Reviewed-by: George Shen <[email protected]>
Acked-by: Wayne Lin <[email protected]>
Signed-off-by: Michael Strauss <[email protected]>
Tested-by: Daniel Wheeler <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
2 years agodrm/amd/display: fix dcn315 memory channel count and width read
Dmytro Laktyushkin [Tue, 30 Aug 2022 19:16:40 +0000 (15:16 -0400)]
drm/amd/display: fix dcn315 memory channel count and width read

[Why & How]
Correctly set ddr5 channel width to 8 bytes

Reviewed-by: Jun Lei <[email protected]>
Acked-by: Wayne Lin <[email protected]>
Signed-off-by: Dmytro Laktyushkin <[email protected]>
Tested-by: Daniel Wheeler <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
2 years agodrm/amd/display: Fix double cursor on non-video RGB MPO
Leo Li [Tue, 30 Aug 2022 20:38:16 +0000 (16:38 -0400)]
drm/amd/display: Fix double cursor on non-video RGB MPO

[Why]

DC makes use of layer_index (zpos) when picking the HW plane to enable
HW cursor on. However, some compositors will not attach zpos information
to each DRM plane. Consequently, in amdgpu, we default layer_index to 0
and do not update it.

This causes said DC logic to enable HW cursor on all planes of the same
layer_index, which manifests as a double cursor issue if one of the
planes is scaled (and hence scaling the cursor as well).

[How]

Use DRM core helpers to calculate a normalized_zpos value for each
drm_plane_state under each crtc, within the atomic state.

This helper will first consider existing zpos values, and if
identical/unset, fallback to plane ID ordering.

The normalized_zpos is then passed to dc_plane_info during atomic check
for later use by the cursor logic.

Reviewed-by: Bhawanpreet Lakha <[email protected]>
Acked-by: Wayne Lin <[email protected]>
Signed-off-by: Leo Li <[email protected]>
Tested-by: Daniel Wheeler <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
2 years agodrm/amd/display: Only consider pixle rate div policy for DCN32+
Alvin Lee [Wed, 31 Aug 2022 14:53:27 +0000 (10:53 -0400)]
drm/amd/display: Only consider pixle rate div policy for DCN32+

[Why and How]
- Only consider pixel rate div policy for DCN32+

Reviewed-by: Martin Leung <[email protected]>
Acked-by: Wayne Lin <[email protected]>
Signed-off-by: Alvin Lee <[email protected]>
Tested-by: Daniel Wheeler <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
2 years agodrm/amd/display: Various logs added
Leo Chen [Mon, 29 Aug 2022 19:42:27 +0000 (15:42 -0400)]
drm/amd/display: Various logs added

[Why & How]
Added logs for panel delays, spread_spectrum_percentage,
and gpuclk_ss_percentage to facilitate debugging.

Reviewed-by: Charlene Liu <[email protected]>
Acked-by: Wayne Lin <[email protected]>
Signed-off-by: Leo Chen <[email protected]>
Tested-by: Daniel Wheeler <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
2 years agodrm/amd/display: add debug option for dramclk_change_latency in apu
Charlene Liu [Mon, 29 Aug 2022 21:32:37 +0000 (17:32 -0400)]
drm/amd/display: add debug option for dramclk_change_latency in apu

[Why & How]
Support dramclk change latency change via debug option and add some
code isolation.

Reviewed-by: Martin Leung <[email protected]>
Acked-by: Wayne Lin <[email protected]>
Signed-off-by: Charlene Liu <[email protected]>
Tested-by: Daniel Wheeler <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
2 years agodrm/amd/display: Fix pipe split prediction
Alvin Lee [Mon, 29 Aug 2022 14:33:21 +0000 (10:33 -0400)]
drm/amd/display: Fix pipe split prediction

[Why & How]
- Pipe split prediction previously only took into
account MPC split. We must also consider when
ODM combine is required, and when we apply ODM
combine by policy.

- Also re-work DET allocation function as it wasn't
properly splitting the DET per stream, per plane.

Reviewed-by: Jun Lei <[email protected]>
Acked-by: Wayne Lin <[email protected]>
Signed-off-by: Alvin Lee <[email protected]>
Tested-by: Daniel Wheeler <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
2 years agodrm/amd/display: Remove some unused definitions from DCN32/321
Aurabindo Pillai [Tue, 6 Sep 2022 15:11:26 +0000 (11:11 -0400)]
drm/amd/display: Remove some unused definitions from DCN32/321

[Why&How]
After reg offset initialization was switched to runtime rather than
compile time, some of the defintions are not needed anymore and can
be removed.

Acked-by: Wayne Lin <[email protected]>
Signed-off-by: Aurabindo Pillai <[email protected]>
Tested-by: Daniel Wheeler <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
2 years agodrm/amd/display: Port DCN30 420 logic to DCN32
Chris Park [Mon, 12 Sep 2022 14:36:49 +0000 (22:36 +0800)]
drm/amd/display: Port DCN30 420 logic to DCN32

[Why]
420 modes are limited by FMT buffer width of 4096
which requires multi-pipe support in form of ODM
combine.  If 420 modes have greater HActive than
4096, the DML logic should accomodate whether
it should be rejected, or ODM combine 2:1 or 4:1
is triggered accordingly.

[How]
FMT Buffer limit of 4096 in DCN32. Force ODM
combine depending on HActive and FMT Buffer limit.
Reject modes if TMDS 420 and above 4096.

Acked-by: Wayne Lin <[email protected]>
Signed-off-by: Chris Park <[email protected]>
Tested-by: Daniel Wheeler <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
2 years agodrm/amd/display: clean up some inconsistent indentings
Yang Li [Thu, 15 Sep 2022 01:58:02 +0000 (09:58 +0800)]
drm/amd/display: clean up some inconsistent indentings

clean up some inconsistent indentings

Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=2182
Reported-by: Abaci Robot <[email protected]>
Signed-off-by: Yang Li <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
2 years agodrm/amd/display: clean up some inconsistent indentings
Yang Li [Thu, 15 Sep 2022 01:58:01 +0000 (09:58 +0800)]
drm/amd/display: clean up some inconsistent indentings

clean up some inconsistent indentings

Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=2181
Reported-by: Abaci Robot <[email protected]>
Signed-off-by: Yang Li <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
2 years agodrm/amd/display: clean up some inconsistent indentings
Yang Li [Thu, 15 Sep 2022 01:58:00 +0000 (09:58 +0800)]
drm/amd/display: clean up some inconsistent indentings

clean up some inconsistent indentings

Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=2180
Reported-by: Abaci Robot <[email protected]>
Signed-off-by: Yang Li <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
2 years agodrm/amd/display: clean up some inconsistent indentings
Yang Li [Thu, 15 Sep 2022 01:57:59 +0000 (09:57 +0800)]
drm/amd/display: clean up some inconsistent indentings

clean up some inconsistent indentings

Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=2179
Reported-by: Abaci Robot <[email protected]>
Signed-off-by: Yang Li <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
2 years agodrm/amd/display: clean up some inconsistent indentings
Yang Li [Thu, 15 Sep 2022 01:57:58 +0000 (09:57 +0800)]
drm/amd/display: clean up some inconsistent indentings

clean up some inconsistent indentings

Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=2178
Reported-by: Abaci Robot <[email protected]>
Signed-off-by: Yang Li <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
2 years agodrm/amd/display: clean up some inconsistent indentings
Yang Li [Thu, 15 Sep 2022 01:57:57 +0000 (09:57 +0800)]
drm/amd/display: clean up some inconsistent indentings

clean up some inconsistent indentings

Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=2177
Reported-by: Abaci Robot <[email protected]>
Signed-off-by: Yang Li <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
2 years agodrm/amdkfd: Fix spelling mistake "detroyed" -> "destroyed"
Colin Ian King [Wed, 14 Sep 2022 17:15:05 +0000 (18:15 +0100)]
drm/amdkfd: Fix spelling mistake "detroyed" -> "destroyed"

There is a spelling mistake in a pr_debug message. Fix it.

Signed-off-by: Colin Ian King <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
2 years agodrm/amdgpu: add rlcv/rlcp version info to debugfs
Hawking Zhang [Wed, 14 Sep 2022 02:46:37 +0000 (10:46 +0800)]
drm/amdgpu: add rlcv/rlcp version info to debugfs

amdgpu_firmware_info debugfs will show rlcv/rlcp
ucode version info

Signed-off-by: Hawking Zhang <[email protected]>
Reviewed-by: Likun Gao <[email protected]>
Reviewed-by: Feifei Xu <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
2 years agodrm/amdgpu: add two new subquery ids
Hawking Zhang [Tue, 13 Sep 2022 11:37:14 +0000 (19:37 +0800)]
drm/amdgpu: add two new subquery ids

To support query rlcp and rlcv firmware version from
existing AMDGPU_INFO_FW_VERSION interface

Signed-off-by: Hawking Zhang <[email protected]>
Reviewed-by: Likun Gao <[email protected]>
Reviewed-by: Feifei Xu <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
2 years agodrm/amdgpu: support print rlc v2_x ucode hdr
Hawking Zhang [Tue, 13 Sep 2022 11:19:55 +0000 (19:19 +0800)]
drm/amdgpu: support print rlc v2_x ucode hdr

add rlc v2_x support to print_rlc_hdr helper

Signed-off-by: Hawking Zhang <[email protected]>
Reviewed-by: Likun Gao <[email protected]>
Reviewed-by: Feifei Xu <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
2 years agodrm/amdgpu: save rlcv/rlcp ucode version in amdgpu_gfx
Hawking Zhang [Tue, 13 Sep 2022 11:18:25 +0000 (19:18 +0800)]
drm/amdgpu: save rlcv/rlcp ucode version in amdgpu_gfx

cache rlcv/rlcvp ucode version info in amdgpu_gfx
structure

Signed-off-by: Hawking Zhang <[email protected]>
Reviewed-by: Likun Gao <[email protected]>
Reviewed-by: Feifei Xu <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
2 years agodrm/amdkfd: Use the consolidated MQD manager functions for GFX11
Shiwu Zhang [Wed, 7 Sep 2022 03:03:22 +0000 (11:03 +0800)]
drm/amdkfd: Use the consolidated MQD manager functions for GFX11

To remove duplication for GFX11 as well, use the common MQD manager
functions defined in kfd_mqd_manager.c for all version of managers

Signed-off-by: Shiwu Zhang <[email protected]>
Acked-by: Felix Kuehling <[email protected]>
Reviewed-by: Mukul Joshi <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
2 years agodrm/amdgpu: Update PTE flags with TF enabled
Mukul Joshi [Wed, 7 Sep 2022 14:46:58 +0000 (10:46 -0400)]
drm/amdgpu: Update PTE flags with TF enabled

This patch updates the PTE flags when translate further (TF) is
enabled:
- With translate_further enabled, invalid PTEs can be 0. Reading
  consecutive invalid PTEs as 0 is considered a fault. To prevent
  this, ensure invalid PTEs have at least 1 bit set.
- The current invalid PTE flags settings to translate a retry fault
  into a no-retry fault, doesn't work with TF enabled. As a result,
  update invalid PTE flags settings which works for both TF enabled
  and disabled case.

Fixes: 352e683b72e79d ("drm/amdgpu: Enable translate_further to extend UTCL2 reach")
Reviewed-by: Christian König <[email protected]>
Reviewed-by: Felix Kuehling <[email protected]>
Signed-off-by: Mukul Joshi <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
2 years agodrm/amdgpu: SDMA update use unlocked iterator
Philip Yang [Tue, 13 Sep 2022 19:46:30 +0000 (15:46 -0400)]
drm/amdgpu: SDMA update use unlocked iterator

SDMA update page table may be called from unlocked context, this
generate below warning. Use unlocked iterator to handle this case.

WARNING: CPU: 0 PID: 1475 at
drivers/dma-buf/dma-resv.c:483 dma_resv_iter_next
Call Trace:
 dma_resv_iter_first+0x43/0xa0
 amdgpu_vm_sdma_update+0x69/0x2d0 [amdgpu]
 amdgpu_vm_ptes_update+0x29c/0x870 [amdgpu]
 amdgpu_vm_update_range+0x2f6/0x6c0 [amdgpu]
 svm_range_unmap_from_gpus+0x115/0x300 [amdgpu]
 svm_range_cpu_invalidate_pagetables+0x510/0x5e0 [amdgpu]
 __mmu_notifier_invalidate_range_start+0x1d3/0x230
 unmap_vmas+0x140/0x150
 unmap_region+0xa8/0x110

Signed-off-by: Philip Yang <[email protected]>
Suggested-by: Felix Kuehling <[email protected]>
Reviewed-by: Christian König <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
2 years agodma-buf: fix dma_fence_default_wait() signaling check
Christian König [Mon, 19 Sep 2022 12:00:33 +0000 (14:00 +0200)]
dma-buf: fix dma_fence_default_wait() signaling check

That check must now come after grabing the spinlock, not before.

Signed-off-by: Christian König <[email protected]>
Fixes: b96fb1e724ae ("dma-buf: dma_fence_wait must enable signaling")
Acked-by: Alex Deucher <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2 years agodrm/i915/gem: Really move i915_gem_context.link under ref protection
Chris Wilson [Fri, 16 Sep 2022 09:24:03 +0000 (11:24 +0200)]
drm/i915/gem: Really move i915_gem_context.link under ref protection

i915_perf assumes that it can use the i915_gem_context reference to
protect its i915->gem.contexts.list iteration. However, this requires
that we do not remove the context from the list until after we drop the
final reference and release the struct. If, as currently, we remove the
context from the list during context_close(), the link.next pointer may
be poisoned while we are holding the context reference and cause a GPF:

[ 4070.573157] i915 0000:00:02.0: [drm:i915_perf_open_ioctl [i915]] filtering on ctx_id=0x1fffff ctx_id_mask=0x1fffff
[ 4070.574881] general protection fault, probably for non-canonical address 0xdead000000000100: 0000 [#1] PREEMPT SMP
[ 4070.574897] CPU: 1 PID: 284392 Comm: amd_performance Tainted: G            E     5.17.9 #180
[ 4070.574903] Hardware name: Intel Corporation NUC7i5BNK/NUC7i5BNB, BIOS BNKBL357.86A.0052.2017.0918.1346 09/18/2017
[ 4070.574907] RIP: 0010:oa_configure_all_contexts.isra.0+0x222/0x350 [i915]
[ 4070.574982] Code: 08 e8 32 6e 10 e1 4d 8b 6d 50 b8 ff ff ff ff 49 83 ed 50 f0 41 0f c1 04 24 83 f8 01 0f 84 e3 00 00 00 85 c0 0f 8e fa 00 00 00 <49> 8b 45 50 48 8d 70 b0 49 8d 45 50 48 39 44 24 10 0f 85 34 fe ff
[ 4070.574990] RSP: 0018:ffffc90002077b78 EFLAGS: 00010202
[ 4070.574995] RAX: 0000000000000002 RBX: 0000000000000002 RCX: 0000000000000000
[ 4070.575000] RDX: 0000000000000001 RSI: ffffc90002077b20 RDI: ffff88810ddc7c68
[ 4070.575004] RBP: 0000000000000001 R08: ffff888103242648 R09: fffffffffffffffc
[ 4070.575008] R10: ffffffff82c50bc0 R11: 0000000000025c80 R12: ffff888101bf1860
[ 4070.575012] R13: dead0000000000b0 R14: ffffc90002077c04 R15: ffff88810be5cabc
[ 4070.575016] FS:  00007f1ed50c0780(0000) GS:ffff88885ec80000(0000) knlGS:0000000000000000
[ 4070.575021] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[ 4070.575025] CR2: 00007f1ed5590280 CR3: 000000010ef6f005 CR4: 00000000003706e0
[ 4070.575029] Call Trace:
[ 4070.575033]  <TASK>
[ 4070.575037]  lrc_configure_all_contexts+0x13e/0x150 [i915]
[ 4070.575103]  gen8_enable_metric_set+0x4d/0x90 [i915]
[ 4070.575164]  i915_perf_open_ioctl+0xbc0/0x1500 [i915]
[ 4070.575224]  ? asm_common_interrupt+0x1e/0x40
[ 4070.575232]  ? i915_oa_init_reg_state+0x110/0x110 [i915]
[ 4070.575290]  drm_ioctl_kernel+0x85/0x110
[ 4070.575296]  ? update_load_avg+0x5f/0x5e0
[ 4070.575302]  drm_ioctl+0x1d3/0x370
[ 4070.575307]  ? i915_oa_init_reg_state+0x110/0x110 [i915]
[ 4070.575382]  ? gen8_gt_irq_handler+0x46/0x130 [i915]
[ 4070.575445]  __x64_sys_ioctl+0x3c4/0x8d0
[ 4070.575451]  ? __do_softirq+0xaa/0x1d2
[ 4070.575456]  do_syscall_64+0x35/0x80
[ 4070.575461]  entry_SYSCALL_64_after_hwframe+0x44/0xae
[ 4070.575467] RIP: 0033:0x7f1ed5c10397
[ 4070.575471] Code: 3c 1c e8 1c ff ff ff 85 c0 79 87 49 c7 c4 ff ff ff ff 5b 5d 4c 89 e0 41 5c c3 66 0f 1f 84 00 00 00 00 00 b8 10 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d a9 da 0d 00 f7 d8 64 89 01 48
[ 4070.575478] RSP: 002b:00007ffd65c8d7a8 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
[ 4070.575484] RAX: ffffffffffffffda RBX: 0000000000000006 RCX: 00007f1ed5c10397
[ 4070.575488] RDX: 00007ffd65c8d7c0 RSI: 0000000040106476 RDI: 0000000000000006
[ 4070.575492] RBP: 00005620972f9c60 R08: 000000000000000a R09: 0000000000000005
[ 4070.575496] R10: 000000000000000d R11: 0000000000000246 R12: 000000000000000a
[ 4070.575500] R13: 000000000000000d R14: 0000000000000000 R15: 00007ffd65c8d7c0
[ 4070.575505]  </TASK>
[ 4070.575507] Modules linked in: nls_ascii(E) nls_cp437(E) vfat(E) fat(E) i915(E) x86_pkg_temp_thermal(E) intel_powerclamp(E) crct10dif_pclmul(E) crc32_pclmul(E) crc32c_intel(E) aesni_intel(E) crypto_simd(E) intel_gtt(E) cryptd(E) ttm(E) rapl(E) intel_cstate(E) drm_kms_helper(E) cfbfillrect(E) syscopyarea(E) cfbimgblt(E) intel_uncore(E) sysfillrect(E) mei_me(E) sysimgblt(E) i2c_i801(E) fb_sys_fops(E) mei(E) intel_pch_thermal(E) i2c_smbus(E) cfbcopyarea(E) video(E) button(E) efivarfs(E) autofs4(E)
[ 4070.575549] ---[ end trace 0000000000000000 ]---

v3: fix incorrect syntax of spin_lock() replacing spin_lock_irqsave()

v2: irqsave not required in a worker, neither conversion to irq safe
    elsewhere (Tvrtko),
  - perf: it's safe to call gen8_configure_context() even if context has
    been closed, no need to check,
  - drop unrelated cleanup (Andi, Tvrtko)

Reported-by: Mark Janes <[email protected]>
Closes: https://gitlab.freedesktop.org/drm/intel/issues/6222
References: a4e7ccdac38e ("drm/i915: Move context management under GEM")
Fixes: f8246cf4d9a9 ("drm/i915/gem: Drop free_work for GEM contexts")
Signed-off-by: Chris Wilson <[email protected]>
Reviewed-by: Andi Shyti <[email protected]>
Signed-off-by: Janusz Krzysztofik <[email protected]>
Cc: Tvrtko Ursulin <[email protected]>
Cc: <[email protected]> # v5.12+
Signed-off-by: Andi Shyti <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2 years agodrm/i915/gem: Flush contexts on driver release
Janusz Krzysztofik [Fri, 16 Sep 2022 09:24:02 +0000 (11:24 +0200)]
drm/i915/gem: Flush contexts on driver release

Due to i915_perf assuming that it can use the i915_gem_context reference
to protect its i915->gem.contexts.list iteration, we need to defer removal
of the context from the list until last reference to the context is put.
However, there is a risk of triggering kernel warning on contexts list not
empty at driver release time if we deleagate that task to a worker for
i915_gem_context_release_work(), unless that work is flushed first.
Unfortunately, it is not flushed on driver release.  Fix it.

Instead of additionally calling flush_workqueue(), either directly or via
a new dedicated wrapper around it, replace last call to
i915_gem_drain_freed_objects() with existing i915_gem_drain_workqueue()
that performs both tasks.

Fixes: 75eefd82581f ("drm/i915: Release i915_gem_context from a worker")
Suggested-by: Chris Wilson <[email protected]>
Signed-off-by: Janusz Krzysztofik <[email protected]>
Reviewed-by: Andi Shyti <[email protected]>
Cc: [email protected] # v5.16+
Signed-off-by: Andi Shyti <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2 years agodrm/i915/mtl: Add MTL forcewake support
Matt Roper [Sat, 10 Sep 2022 00:16:31 +0000 (17:16 -0700)]
drm/i915/mtl: Add MTL forcewake support

MTL has separate forcewake tables for the primary/render GT and the
media GT; each GT's intel_uncore will use a separate forcewake table and
should only initialize the domains that are relevant to that GT.  The GT
ack register also moves to a new location of (GSI base + 0xDFC) on this
platform.

Note that although our uncore handlers take care of transparently
redirecting all register accesses in the media GT's GSI range to their
new offset at 0x380000, the forcewake ranges listed in the table should
use the final, post-translation offsets.

NOTE:  There are two ranges in the media IP that have multicast
registers where the two register instances reside in different power
wells (either VD0 or VD2).  We don't have an easy way to deal with this
today (and in fact we don't even access these register ranges in the
driver today), so for now we just mark those ranges as FORCEWAKE_ALL
which will cause all of the media power wells to be grabbed, ensuring
proper operation.  If we start reading/writing in those ranges in the
future, we can re-visit whether it's worth adding extra steering
complexity into our forcewake support.

Bspec: 67788, 67789, 52077
Cc: Radhakrishna Sripada <[email protected]>
Signed-off-by: Matt Roper <[email protected]>
Reviewed-by: Harish Chegondi <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2 years agoRevert "drm/bridge: chrontel-ch7033: Add byteswap order setting"
Robert Foss [Mon, 19 Sep 2022 10:20:09 +0000 (12:20 +0200)]
Revert "drm/bridge: chrontel-ch7033: Add byteswap order setting"

Revert this patch since it depends on devicetree functionality that
previously has been reverted in the below commit.

commit e798ba3374a1 ("Revert "dt-bindings: Add byteswap order to chrontel ch7033"")

This reverts commit ce9564cfc9aea65e68eb343c599317633bc2321a.

Signed-off-by: Robert Foss <[email protected]>
Reviewed-by: Laurent Pinchart <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2 years agoRevert "Revert "drm/bridge: ti-sn65dsi86: Implement bridge connector operations for...
Robert Foss [Mon, 19 Sep 2022 10:20:08 +0000 (12:20 +0200)]
Revert "Revert "drm/bridge: ti-sn65dsi86: Implement bridge connector operations for DP""

This commit was accidentally reverted instead of another commit, and
therefore needs to be reinstated.

This reverts commit 8c9c40ec83445b188fb6b59e119bf5c2de81b02d.

Fixes: 8c9c40ec8344 ("Revert "drm/bridge: ti-sn65dsi86: Implement bridge connector operations for DP"")
Signed-off-by: Robert Foss <[email protected]>
Reviewed-by: Laurent Pinchart <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2 years agodrm/mediatek: dp: change mtk_dp_driver to static
Yang Yingliang [Tue, 13 Sep 2022 13:49:29 +0000 (21:49 +0800)]
drm/mediatek: dp: change mtk_dp_driver to static

mtk_dp_driver is only used in mtk_dp.c now, change it
to static.

Fixes: f70ac097a2cf ("drm/mediatek: Add MT8195 Embedded DisplayPort driver")
Signed-off-by: Yang Yingliang <[email protected]>
Reviewed-by: Dmitry Osipenko <[email protected]>
Acked-by: Chun-Kuang Hu <[email protected]>
Signed-off-by: Dmitry Osipenko <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2 years agodrm/mediatek: dp: Fix compiler warning in mtk_dp_video_mute()
Bo-Chen Chen [Fri, 16 Sep 2022 13:38:21 +0000 (21:38 +0800)]
drm/mediatek: dp: Fix compiler warning in mtk_dp_video_mute()

Fix debug message formatting by using %s instead of 0x%x.

Fixes: f70ac097a2cf ("drm/mediatek: Add MT8195 Embedded DisplayPort driver")
Reported-by: Chun-Kuang Hu <[email protected]>
Signed-off-by: Bo-Chen Chen <[email protected]>
Reviewed-by: Matthias Brugger <[email protected]>
Acked-by: Chun-Kuang Hu <[email protected]>
Reviewed-by: AngeloGioacchino Del Regno <[email protected]>
Signed-off-by: Dmitry Osipenko <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2 years agodrm/mediatek: dp: Remove unused register definitions
Bo-Chen Chen [Fri, 16 Sep 2022 13:38:20 +0000 (21:38 +0800)]
drm/mediatek: dp: Remove unused register definitions

Some definitions in mtk_dp_reg.h are not used, so remove these
redundant codes.

Signed-off-by: Bo-Chen Chen <[email protected]>
Reviewed-by: AngeloGioacchino Del Regno <[email protected]>
Reviewed-by: Matthias Brugger <[email protected]>
Acked-by: Chun-Kuang Hu <[email protected]>
Signed-off-by: Dmitry Osipenko <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2 years agodrm/mediatek: dp: Reduce indentation in mtk_dp_bdg_detect()
Bo-Chen Chen [Fri, 16 Sep 2022 13:38:19 +0000 (21:38 +0800)]
drm/mediatek: dp: Reduce indentation in mtk_dp_bdg_detect()

In order to improve human readability, reduce the indentation by
returning early if the dp/edp cable is not plugged in.

Signed-off-by: Bo-Chen Chen <[email protected]>
Acked-by: Chun-Kuang Hu <[email protected]>
Reviewed-by: AngeloGioacchino Del Regno <[email protected]>
Signed-off-by: Dmitry Osipenko <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2 years agodrm/gma500: Call acpi_video_register_backlight()
Hans de Goede [Sat, 17 Sep 2022 20:59:20 +0000 (22:59 +0200)]
drm/gma500: Call acpi_video_register_backlight()

On machines without an Intel video opregion the acpi_video driver
immediately probes the ACPI video bus and used to also immediately
register acpi_video# backlight devices when supported.

Once the drm/kms driver then loaded later and possibly registered
a native backlight device then the drivers/acpi/video_detect.c code
unregistered the acpi_video0 device to avoid there being 2 backlight
devices (when acpi_video_get_backlight_type()==native).

This means that userspace used to briefly see 2 devices and the
disappearing of acpi_video0 after a brief time confuses the systemd
backlight level save/restore code, see e.g.:
https://bbs.archlinux.org/viewtopic.php?id=269920

To fix this the ACPI video code has been modified to make backlight class
device registration a separate step, relying on the drm/kms driver to
ask for the acpi_video backlight registration after it is done setting up
its native backlight device.

Add a call to the new acpi_video_register_backlight() function after
setting up the gma500's native backlight, so that the acpi_video backlight
device gets registered on systems where the gma500's native backlight
device is not registered.

Signed-off-by: Hans de Goede <[email protected]>
Acked-by: Patrik Jakobsson <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2 years agodrm/gma500: Don't register backlight when another backlight should be used
Hans de Goede [Sat, 17 Sep 2022 20:59:19 +0000 (22:59 +0200)]
drm/gma500: Don't register backlight when another backlight should be used

Before this commit when we want userspace to use the acpi_video backlight
device we register both the GPU's native backlight device and acpi_video's
firmware acpi_video# backlight device. This relies on userspace preferring
firmware type backlight devices over native ones.

Registering 2 backlight devices for a single display really is
undesirable, don't register the GPU's native backlight device when
another backlight device should be used.

Signed-off-by: Hans de Goede <[email protected]>
Acked-by: Patrik Jakobsson <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2 years agodrm/gma500: Use backlight_get_brightness() to get the brightness
Hans de Goede [Sat, 17 Sep 2022 20:59:18 +0000 (22:59 +0200)]
drm/gma500: Use backlight_get_brightness() to get the brightness

Use backlight_get_brightness() instead of directly referencing
bd->props.brightness. This will take backlight_is_blank() into account,
properly setting brightness to 0 when screen-blanking has been requested
through the backlight sysfs interface.

Suggested-by: Sam Ravnborg <[email protected]>
Acked-by: Sam Ravnborg <[email protected]>
Signed-off-by: Hans de Goede <[email protected]>
Acked-by: Patrik Jakobsson <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2 years agodrm/gma500: Change registered backlight device type to raw/native
Hans de Goede [Sat, 17 Sep 2022 20:59:17 +0000 (22:59 +0200)]
drm/gma500: Change registered backlight device type to raw/native

Change the type for the registered backlight class device from platform
to raw/native.

The poulsbo/cedarview/oaktrail backlight support is using native GPU
backlight control and as such the type should be raw (aka native) as
is done by all the other native GPU backlight driver code.

Note this will not change much from userspace's point of view.
poulsbo/cedarview laptops typically offer both an ACPI-video
backlight interface as well as the native GPU backlight interface.

The /sys/class/backlight/acpi_video0 has a type of firmware and
userspace typically looks for firmware devices before looking
for platform devices. The typical standard lookup order is:
firmware -> platform -> raw

This means that both before and after this change typical userspace
backlight consumers (sich as e.g. GNOME) will prefer the firmware
acpi_video0 backlight device.

This has been tested on a Packard Bell Dot SC (Intel Atom N2600, cedarview)
and a Sony Vaio vpc-x11s1e (Intel N540, poulsbo) laptop.

Signed-off-by: Hans de Goede <[email protected]>
Acked-by: Patrik Jakobsson <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2 years agodrm/gma500: Refactor backlight support (v2)
Hans de Goede [Sat, 17 Sep 2022 20:59:16 +0000 (22:59 +0200)]
drm/gma500: Refactor backlight support (v2)

Refactor backlight support so that the gma_backlight_enable() /
gma_backlight_disable() / gma_backlight_set() functions used by
the Opregion handle will also work if no backlight_device gets
registered.

This is a preparation patch for not registering the gma500's own backlight
device when acpi_video should be used, since registering 2 backlight
devices for a single display really is undesirable.

Since the acpi-video interface often uses the OpRegion we need to keep
the OpRegion functional even when dev_priv->backlight_device is NULL.

As a result of this refactor the actual backlight_device_register()
call is moved to the shared backlight.c code and all #ifdefs related to
CONFIG_BACKLIGHT_CLASS_DEVICE are now also limited to backlight.c .

No functional changes intended.

This has been tested on a Packard Bell Dot SC (Intel Atom N2600, cedarview)
and a Sony Vaio vpc-x11s1e (Intel N540, poulsbo) laptop.

Changes in v2:
- Fix unused variable warnings when CONFIG_BACKLIGHT is not selected by
  marking the 2 variables as  __maybe_unused.

Signed-off-by: Hans de Goede <[email protected]>
Acked-by: Patrik Jakobsson <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2 years agodrm/msm/hdmi: make hdmi_phy_8996 OF clk provider
Dmitry Baryshkov [Mon, 4 Jul 2022 16:11:47 +0000 (19:11 +0300)]
drm/msm/hdmi: make hdmi_phy_8996 OF clk provider

On MSM8996 the HDMI PHY provides the PLL clock to the MMCC. As we are
preparing to convert the MSM8996 to use DT clocks properties (rather
than global clock names), register the OF clock provider.

While we are at it, also change the driver to use clk_parent_data rather
parent_names to setup a link to the XO clock.

Signed-off-by: Dmitry Baryshkov <[email protected]>
Reviewed-by: Abhinav Kumar <[email protected]>
Patchwork: https://patchwork.freedesktop.org/patch/492318/
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Dmitry Baryshkov <[email protected]>
Signed-off-by: Rob Clark <[email protected]>
2 years agodt-bindings: phy: qcom, hdmi-phy-qmp: add clock-cells and XO clock
Dmitry Baryshkov [Mon, 4 Jul 2022 16:11:46 +0000 (19:11 +0300)]
dt-bindings: phy: qcom, hdmi-phy-qmp: add clock-cells and XO clock

As the QMP HDMI PHY is a clock provider, add constant #clock-cells
property. For the compatibility with older DTs the property is not
marked as required. Also add the XO clock to the list of the clocks used
by the driver.

Reviewed-by: Krzysztof Kozlowski <[email protected]>
Signed-off-by: Dmitry Baryshkov <[email protected]>
Acked-by: Vinod Koul <[email protected]>
Patchwork: https://patchwork.freedesktop.org/patch/492316/
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Dmitry Baryshkov <[email protected]>
Signed-off-by: Rob Clark <[email protected]>
2 years agodrm/msm/dsi: Remove use of device_node in dsi_host_parse_dt()
Nathan Chancellor [Mon, 29 Aug 2022 16:54:50 +0000 (09:54 -0700)]
drm/msm/dsi: Remove use of device_node in dsi_host_parse_dt()

Clang warns:

  drivers/gpu/drm/msm/dsi/dsi_host.c:1903:14: error: variable 'device_node' is uninitialized when used here [-Werror,-Wuninitialized]
          of_node_put(device_node);
                      ^~~~~~~~~~~
  drivers/gpu/drm/msm/dsi/dsi_host.c:1870:44: note: initialize the variable 'device_node' to silence this warning
          struct device_node *endpoint, *device_node;
                                                    ^
                                                    = NULL
  1 error generated.

device_node's assignment was removed but not all of its uses. Remove the
call to of_node_put() and the variable declaration to clean up the
warning.

Fixes: 36246dd50225 ("drm/msm/dsi: switch to DRM_PANEL_BRIDGE")
Link: https://github.com/ClangBuiltLinux/linux/issues/1700
Signed-off-by: Nathan Chancellor <[email protected]>
Reviewed-by: Abhinav Kumar <[email protected]>
Reviewed-by: Dmitry Baryshkov <[email protected]>
Patchwork: https://patchwork.freedesktop.org/patch/500182/
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Dmitry Baryshkov <[email protected]>
Signed-off-by: Rob Clark <[email protected]>
2 years agodrm/msm/dsi: switch to DRM_PANEL_BRIDGE
Dmitry Baryshkov [Tue, 12 Jul 2022 13:22:58 +0000 (16:22 +0300)]
drm/msm/dsi: switch to DRM_PANEL_BRIDGE

Currently the DSI driver has two separate paths: one if the next device
in a chain is a bridge and another one if the panel is connected
directly to the DSI host. Simplify the code path by using panel-bridge
driver (already selected in Kconfig) and dropping support for
handling the panel directly.

Signed-off-by: Dmitry Baryshkov <[email protected]>
Reviewed-by: Abhinav Kumar <[email protected]>
Patchwork: https://patchwork.freedesktop.org/patch/493608/
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Dmitry Baryshkov <[email protected]>
Signed-off-by: Rob Clark <[email protected]>
2 years agodrm/panel: drop DSC pps pointer
Dmitry Baryshkov [Mon, 11 Jul 2022 09:43:19 +0000 (12:43 +0300)]
drm/panel: drop DSC pps pointer

Complete the move of DSC data pointer from struct drm_panel to struct
mipi_dsi_device.

Signed-off-by: Dmitry Baryshkov <[email protected]>
Reviewed-by: Abhinav Kumar <[email protected]>
Patchwork: https://patchwork.freedesktop.org/patch/493309/
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Dmitry Baryshkov <[email protected]>
Signed-off-by: Rob Clark <[email protected]>
This page took 0.123361 seconds and 4 git commands to generate.