Compare commits

...

25 Commits

Author SHA1 Message Date
Linus Torvalds e538109ac7 drm fixes for 6.18 final
i915:
 - Reject async flips when PSR's selective fetch is enabled
 
 xe:
 - Fix resource leak in xe_guc_ct_init_noalloc()'s error path
 - Fix stack_depot usage without STACKDEPOT_ALWAYS_INIT
 - Fix overflow in conversion from clock tics to msec
 
 amdgpu:
 - Unified MES fix
 - HDMI fix
 - Cursor fix
 - Bightness fix
 - EDID reading improvement
 - UserQ fix
 - Cyan Skillfish IP discovery fix
 
 bridge:
 - sil902x: Fix HDMI detection
 
 imagination:
 - Update documentation
 
 sti:
 - Fix leaks in probe
 
 vga_switcheroo:
 - Avoid race condition during fbcon initialization
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEEKbZHaGwW9KfbeusDHTzWXnEhr4FAmkpH74ACgkQDHTzWXnE
 hr47/xAAjPXx0uopgvf3arcu0qhPE5jeZbFiVZ9//kyuaG/UujjYLrA9ftgAlCSQ
 6iIQVsOfXeuM4VzNmHWg+CFiKVn8shFjvpYb3Fms6RuLhw3O3+8JGZKHinfVtpv4
 vakF56T1DuS9PvV6HEs6rDT266IbwUWAr6waraRDwsolsqsWXtnof8V7I1Px5MA4
 wQ49clDRN76tvP6K3fUdsaxla+Whdi80XMIs9/Cldr16JQr+NV7bo8zUK/cw0NsK
 lVcQq7i7LqkY2nUTVLBelw5N5dW0VwZBVoQbwjBYI6DKOCtwcRFyEJ8pluUu+TOw
 jhQj0zlTf8BsiIwvKcbr8RkCpLLepzY7iYitOCZ4nAQ1yEdMrz0960cUDhBhydFQ
 WqrXakR7EngI/ulMHj+Uw0bqHf6qNgcH41VD8Z1rsQKL5kzrZoGbwA3oOmav76bP
 QtVdhAFimZSsQnNr1ur0TTFjXSOqWLImXjBnbFZGibFOpwc8px5KgzeBi8E4hmKl
 +GhyO69hQcwnvwA2jMkr8sTZQ2Lom3o02K14uY3TvoPeclW6vVkLYODzG5Y/l1UU
 pn1O5U4O84VnwhlkULAoPSFmdSye3NUvaA2XTUqDFWOalZ9LmPYk1ggayC9PkffE
 yk/kvDpR3A9dVxZnWhEMW8MyItg0PSxYIa9+0syqsILGENBTf7s=
 =plBx
 -----END PGP SIGNATURE-----

Merge tag 'drm-fixes-2025-11-28' of https://gitlab.freedesktop.org/drm/kernel

Pull drm fixes from Dave Airlie:
 "Last one for this round hopefully, mostly the usual suspects,
  xe/amdgpu, with some single fixes otherwise.

  There is one amdgpu HDMI blackscreen bug that came in late in the
  cycle, but it was bisected and the revert is in here.

  i915:
   - Reject async flips when PSR's selective fetch is enabled

  xe:
   - Fix resource leak in xe_guc_ct_init_noalloc()'s error path
   - Fix stack_depot usage without STACKDEPOT_ALWAYS_INIT
   - Fix overflow in conversion from clock tics to msec

  amdgpu:
   - Unified MES fix
   - HDMI fix
   - Cursor fix
   - Bightness fix
   - EDID reading improvement
   - UserQ fix
   - Cyan Skillfish IP discovery fix

  bridge:
   - sil902x: Fix HDMI detection

  imagination:
   - Update documentation

  sti:
   - Fix leaks in probe

  vga_switcheroo:
   - Avoid race condition during fbcon initialization"

* tag 'drm-fixes-2025-11-28' of https://gitlab.freedesktop.org/drm/kernel:
  drm/amdgpu: fix cyan_skillfish2 gpu info fw handling
  drm/amdgpu: attach tlb fence to the PTs update
  drm/amd/display: Increase EDID read retries
  drm/amd/display: Don't change brightness for disabled connectors
  drm/amd/display: Check NULL before accessing
  Revert "drm/amd/display: Move setup_stream_attribute"
  drm/xe: Fix conversion from clock ticks to milliseconds
  drm/xe/guc: Fix stack_depot usage
  drm/xe/guc: Fix resource leak in xe_guc_ct_init_noalloc()
  drm/i915/psr: Reject async flips when selective fetch is enabled
  drm, fbcon, vga_switcheroo: Avoid race condition in fbcon setup
  drm/amd/amdgpu: reserve vm invalidation engine for uni_mes
  drm: sti: fix device leaks at component probe
  drm/imagination: Document pvr_device.power member
  drm/bridge: sii902x: Fix HDMI detection with DRM_BRIDGE_ATTACH_NO_CONNECTOR
2025-11-27 21:06:27 -08:00
Dave Airlie 6dbcb801e1 Driver Changes:
- Fix resource leak in xe_guc_ct_init_noalloc()'s error path (Shuicheng Lin)
  - Fix stack_depot usage without STACKDEPOT_ALWAYS_INIT (Lucas)
  - Fix overflow in conversion from clock tics to msec (Harish Chegondi)
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEE6rM8lpABPHM5FqyDm6KlpjDL6lMFAmko6kgACgkQm6KlpjDL
 6lO84A/6ArsDA9pMeWtk/GHQTL20ABV8LiSfrlC2VMum1agafXdIFZ2ookpyoKI8
 9nzNiFGQJT7V55psamWs25DI+LF//7vq4btNdYunzUk5p+LZOvYtx72MPhdCS4/F
 AfET4NXVtpcOTd+4Lro4zjfUZGB/qObMWRHQKAKXcr5vFhDUHpk1wQgnApKoL8uZ
 4G+GAVpDxW4bhagrNgQD0i6ZrwUWA1mJAyrTbwuYrQp1kZPCfZ7LIQEot+8rcNaB
 ZFKDjr2w2DIt/ue5yx3SLbVIuqZS8GOQMdVH7b6RVgpjEgqBcTQM3vKSt0KFC+71
 8wBs8D6SR+ZR5Guw2qvhobPfea/0pya7WP+8Nv678QnoIcAylMBG9bs5oyR9RoSB
 GNonR/WA69nhH20OEU6h5zjbvdsfo0ICFrBiUHH0njwpFDb9TdJ/LAzVCurvl29p
 gwUcc4v04YrG+Do/NSAH3esGDP2k5e//XD6bgkcZgGpO/Mx4AMHO1dmdtQav1PbY
 m8roRI2fo6TV+LHggLSp2zCP7CRq8t0h03g3Ufx1xDwg5oZ7PLz3ZHSz2LZCoavg
 i3AZtsHszJ3r/uXJePpvJK3qV1F3cv3QdwBl7M3rlrQgTymDsps0d4z8TrTeeI2w
 AUWd9pFunZvFvvQvKzbgfUr3Eq7/22jw4FQpyEpbi/vD1tU1b14=
 =ue6Q
 -----END PGP SIGNATURE-----

Merge tag 'drm-xe-fixes-2025-11-27' of https://gitlab.freedesktop.org/drm/xe/kernel into drm-fixes

Driver Changes:
 - Fix resource leak in xe_guc_ct_init_noalloc()'s error path (Shuicheng Lin)
 - Fix stack_depot usage without STACKDEPOT_ALWAYS_INIT (Lucas)
 - Fix overflow in conversion from clock tics to msec (Harish Chegondi)

Signed-off-by: Dave Airlie <airlied@redhat.com>

From: Lucas De Marchi <lucas.demarchi@intel.com>
Link: https://patch.msgid.link/7ejiqjgthpqybg5svmkind2pszk4fqadxuq7rngchaaw76iept@5pn6sngqj6lk
2025-11-28 12:10:25 +10:00
Dave Airlie 26c7a181fd Short summary of fixes pull:
bridge:
 - sil902x: Fix HDMI detection
 
 imagination:
 - Update documentation
 
 sti:
 - Fix leaks in probe
 
 vga_switcheroo:
 - Avoid race condition during fbcon initialization
 -----BEGIN PGP SIGNATURE-----
 
 iQFPBAABCgA5FiEEchf7rIzpz2NEoWjlaA3BHVMLeiMFAmkoBzEbFIAAAAAABAAO
 bWFudTIsMi41KzEuMTEsMiwyAAoJEGgNwR1TC3ojpPMIAKbDq6ttGcyskNpClupJ
 Owpq8wC8Qzy1fCKgrx2dj2bw2cfgtJTYZtbYo9/dFXnPrdQfo4LlLe3wI0inDe4V
 jvTkFm9SDARC4GGIpVnNgK/XYmp9DA+yJEzopojCnsToVJjvDrGKAsHnXBLK6gX2
 nL/fToNii8Lcae34HKmThg0Lq3o90Y1Aqfr2e3TyuxfctGYGcZ867NlpNOeUJEAe
 nJr+WXxlHL3497Y8d3rAlLrzOUYWT37Bq7y6p0SE3X7QCBtragKN+6AVSXUgfiCR
 tru+WuXdv2BMaBCO5rff1t2rYA7weVDNApcsMRlsFOkFBElogvaagRmOpZI2U2an
 YsE=
 =Jxlj
 -----END PGP SIGNATURE-----

Merge tag 'drm-misc-fixes-2025-11-27' of https://gitlab.freedesktop.org/drm/misc/kernel into drm-fixes

Short summary of fixes pull:

bridge:
- sil902x: Fix HDMI detection

imagination:
- Update documentation

sti:
- Fix leaks in probe

vga_switcheroo:
- Avoid race condition during fbcon initialization

Signed-off-by: Dave Airlie <airlied@redhat.com>

From: Thomas Zimmermann <tzimmermann@suse.de>
Link: https://patch.msgid.link/20251127081007.GA13578@2a02-2454-fd5e-fd00-689d-32c0-780c-bb87.dyn6.pyur.net
2025-11-28 12:04:20 +10:00
Dave Airlie 4fc3ad63dd amd-drm-fixes-6.18-2025-11-26:
amdgpu:
 - Unified MES fix
 - HDMI fix
 - Cursor fix
 - Bightness fix
 - EDID reading improvement
 - UserQ fix
 - Cyan Skillfish IP discovery fix
 -----BEGIN PGP SIGNATURE-----
 
 iHUEABYKAB0WIQQgO5Idg2tXNTSZAr293/aFa7yZ2AUCaSdnEQAKCRC93/aFa7yZ
 2PbnAQCC2OddQOW3jcV0Y9a8qPZfJ+Wf9gWMs8D1x0KLfh0BmwD/e9X8CyVOABmH
 ymScHIJZhvAIKinOrnCcIF9Dij5/xgI=
 =pRN6
 -----END PGP SIGNATURE-----

Merge tag 'amd-drm-fixes-6.18-2025-11-26' of https://gitlab.freedesktop.org/agd5f/linux into drm-fixes

amd-drm-fixes-6.18-2025-11-26:

amdgpu:
- Unified MES fix
- HDMI fix
- Cursor fix
- Bightness fix
- EDID reading improvement
- UserQ fix
- Cyan Skillfish IP discovery fix

Signed-off-by: Dave Airlie <airlied@redhat.com>

From: Alex Deucher <alexander.deucher@amd.com>
Link: https://patch.msgid.link/20251126204925.3316684-1-alexander.deucher@amd.com
2025-11-28 11:57:04 +10:00
Linus Torvalds aa7243aaf1 dma-mapping fixes for Linux 6.18
- two last minute fixes for the recently modified DMA API infrastructure:
 a proper handling of DMA_ATTR_MMIO in dma_iova_unlink() function (me) and
 a regression fix for the code refactoring related to P2PDMA (Pranjal
 Shrivastava)
 -----BEGIN PGP SIGNATURE-----
 
 iHUEABYIAB0WIQSrngzkoBtlA8uaaJ+Jp1EFxbsSRAUCaSh6UAAKCRCJp1EFxbsS
 RCYGAP94GdoTEBmQL1dXLooASbHHAyB5xrd8Di1H/Aqd7maCvAEAgT2+BRPyEtf+
 wiz4mwKMG1RrF9Cj4XqPqJ2NDU1zdQ8=
 =ngH/
 -----END PGP SIGNATURE-----

Merge tag 'dma-mapping-6.18-2025-11-27' of git://git.kernel.org/pub/scm/linux/kernel/git/mszyprowski/linux

Pull dma-mapping fixes from Marek Szyprowski:
 "Two last minute fixes for the recently modified DMA API infrastructure:

   - proper handling of DMA_ATTR_MMIO in dma_iova_unlink() function (me)

   - regression fix for the code refactoring related to P2PDMA (Pranjal
     Shrivastava)"

* tag 'dma-mapping-6.18-2025-11-27' of git://git.kernel.org/pub/scm/linux/kernel/git/mszyprowski/linux:
  dma-direct: Fix missing sg_dma_len assignment in P2PDMA bus mappings
  iommu/dma: add missing support for DMA_ATTR_MMIO for dma_iova_unlink()
2025-11-27 17:29:15 -08:00
Linus Torvalds 3fa77874b4 One more urgent ACPI support fix for 6.18
There is one more commit that needs to be reverted after reverting
 problematic commit 7a8c994cbb ("ACPI: processor: idle: Optimize
 ACPI idle driver registration"), so revert it.
 -----BEGIN PGP SIGNATURE-----
 
 iQFGBAABCAAwFiEEcM8Aw/RY0dgsiRUR7l+9nS/U47UFAmkorhYSHHJqd0Byand5
 c29ja2kubmV0AAoJEO5fvZ0v1OO1HmQH/1mAIwpYlmtXtW8LmGuZsrvZx4PTl8OQ
 QyATMm/0+/gSWXYs79vLikwoRfT0rSEOdZcNk6AwdqeP2ciHLwCAzNnOE7vw80/s
 xo7yj1SswzEZDydEhbxqRFNsJ8hl5VCU7DdsScVtuDFb/vJ0GHkQEu1DsSFJQoSL
 CidC/2RCn0n5egOMdxL/GHemEbdUDGDXr2JilrcNLmcnnArN43+JqdiV8p102oSz
 i8ssS/LIMUMrIMZCuJA1298pZ6Ir1WWgaodyTOYDcmq3u25SSabF5WlS2u0KGgm/
 Ldgl6/lCuMxt+BBJ1r3uq9uHRAWeqY+DpHcZ7q1yFB+rOyRA9za5ERc=
 =X5FV
 -----END PGP SIGNATURE-----

Merge tag 'acpi-6.18-rc8-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm

Pull ACPI fix from Rafael Wysocki:
 "One more urgent ACPI support fix for 6.18

  There is one more commit that needs to be reverted after reverting
  problematic commit 7a8c994cbb ("ACPI: processor: idle: Optimize ACPI
  idle driver registration"), so revert it"

* tag 'acpi-6.18-rc8-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
  Revert "ACPI: processor: Update cpuidle driver check in __acpi_processor_start()"
2025-11-27 17:25:46 -08:00
Dave Airlie b31e2e3bb7 - Reject async flips when PSR's selective fetch is enabled (Ville)
-----BEGIN PGP SIGNATURE-----
 
 iQEzBAABCgAdFiEEbSBwaO7dZQkcLOKj+mJfZA7rE8oFAmknIDwACgkQ+mJfZA7r
 E8qZkQgAsLGliDOMLEw1hFrs+QSDy0uEXaKiIKSjnJ5xrJxFFtQB0a5MWPCEuzRb
 fgkCdIThW0JrCN8c00ayPS5lT9HbeTqcOMnh1PKchbfWrCSkVDns5A9rGQACgvpr
 r5IsgP7eRnyvkfykYXcCkAXk2EHrmn1N620MLsiOp88HnR5YPji3Fetho5Ba9Cx9
 KJfATrjJqn6hcRvhRydZJQ4dhdkMYjXtYMcHF3rkwiowRKReW7LpRgeONqIKfTeL
 40vYVvut1/XK5p82vELc8aZUxzdCQN+SEsezF7ycA5z5f/MJV5UPtw6Z+cB4bm0f
 dpQvqYpp2Lw+3NU633uPoN6IprDBgg==
 =j1e/
 -----END PGP SIGNATURE-----

Merge tag 'drm-intel-fixes-2025-11-26' of https://gitlab.freedesktop.org/drm/i915/kernel into drm-fixes

- Reject async flips when PSR's selective fetch is enabled (Ville)

Signed-off-by: Dave Airlie <airlied@redhat.com>

From: Rodrigo Vivi <rodrigo.vivi@intel.com>
Link: https://patch.msgid.link/aScgY8QMjmyJRBX2@intel.com
2025-11-28 11:16:13 +10:00
Rafael J. Wysocki fbf04215d9 Revert "ACPI: processor: Update cpuidle driver check in __acpi_processor_start()"
Revert commit 8a1b5d412c ("ACPI: processor: Update cpuidle driver
check in __acpi_processor_start()") which depends on commit
7a8c994cbb ("ACPI: processor: idle: Optimize ACPI idle driver
registration") that got reverted.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2025-11-27 20:52:55 +01:00
Pranjal Shrivastava d0d08f4bd7 dma-direct: Fix missing sg_dma_len assignment in P2PDMA bus mappings
Prior to commit a25e7962db ("PCI/P2PDMA: Refactor the p2pdma mapping
helpers"), P2P segments were mapped using the pci_p2pdma_map_segment()
helper. This helper was responsible for populating sg->dma_address,
marking the bus address, and also setting sg_dma_len(sg).

The refactor[1] removed this helper and moved the mapping logic directly
into the callers. While iommu_dma_map_sg() was correctly updated to set
the length in the new flow, it was missed in dma_direct_map_sg().

Thus, in dma_direct_map_sg(), the PCI_P2PDMA_MAP_BUS_ADDR case sets the
dma_address and marks the segment, but immediately executes 'continue',
which causes the loop to skip the standard assignment logic at the end:

    sg_dma_len(sg) = sg->length;

As a result, when CONFIG_NEED_SG_DMA_LENGTH is enabled, the dma_length
field remains uninitialized (zero) for P2P bus address mappings. This
breaks upper-layer drivers (for e.g. RDMA/IB) that rely on sg_dma_len()
to determine the transfer size.

Fix this by explicitly setting the DMA length in the
PCI_P2PDMA_MAP_BUS_ADDR case before continuing to the next scatterlist
entry.

Fixes: a25e7962db ("PCI/P2PDMA: Refactor the p2pdma mapping helpers")
Reported-by: Jacob Moroni <jmoroni@google.com>
Signed-off-by: Pranjal Shrivastava <praan@google.com>

[1]
https://lore.kernel.org/all/ac14a0e94355bf898de65d023ccf8a2ad22a3ece.1746424934.git.leon@kernel.org/

Reviewed-by: Logan Gunthorpe <logang@deltatee.com>
Reviewed-by: Leon Romanovsky <leonro@nvidia.com>
Reviewed-by: Shivaji Kant <shivajikant@google.com>
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Link: https://lore.kernel.org/r/20251126114112.3694469-1-praan@google.com
2025-11-26 21:47:13 +01:00
Alex Deucher 7fa666ab07 drm/amdgpu: fix cyan_skillfish2 gpu info fw handling
If the board supports IP discovery, we don't need to
parse the gpu info firmware.

Backport to 6.18.

Closes: https://gitlab.freedesktop.org/drm/amd/-/issues/4721
Fixes: fa819e3a7c ("drm/amdgpu: add support for cyan skillfish gpu_info")
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit 5427e32fa3)
2025-11-26 12:34:16 -05:00
Prike Liang b4a7f4e7ad drm/amdgpu: attach tlb fence to the PTs update
Ensure the userq TLB flush is emitted only after
the VM update finishes and the PT BOs have been
annotated with bookkeeping fences.

Suggested-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Prike Liang <Prike.Liang@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit f3854e04b7)
Cc: stable@vger.kernel.org
2025-11-26 12:33:05 -05:00
Mario Limonciello (AMD) 8ea9023617 drm/amd/display: Increase EDID read retries
[WHY]
When monitor is still booting EDID read can fail while DPCD read
is successful.  In this case no EDID data will be returned, and this
could happen for a while.

[HOW]
Increase number of attempts to read EDID in dm_helpers_read_local_edid()
to 25.

Closes: https://gitlab.freedesktop.org/drm/amd/-/issues/4672
Cc: Mario Limonciello <mario.limonciello@amd.com>
Cc: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Alex Hung <alex.hung@amd.com>
Signed-off-by: Mario Limonciello (AMD) <superm1@kernel.org>
Signed-off-by: Alex Hung <alex.hung@amd.com>
Tested-by: Dan Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit a76d6f2c76)
Cc: stable@vger.kernel.org
2025-11-26 12:32:05 -05:00
Mario Limonciello (AMD) 81f4d4ba50 drm/amd/display: Don't change brightness for disabled connectors
[WHY]
When a laptop lid is closed the connector is disabled but userspace
can still try to change brightness.  This doesn't work because the
panel is turned off. It will eventually time out, but there is a lot
of stutter along the way.

[How]
Iterate all connectors to check whether the matching one for the backlight
index is enabled.

Closes: https://gitlab.freedesktop.org/drm/amd/-/issues/4675
Cc: Mario Limonciello <mario.limonciello@amd.com>
Cc: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Ray Wu <ray.wu@amd.com>
Signed-off-by: Mario Limonciello (AMD) <superm1@kernel.org>
Signed-off-by: Alex Hung <alex.hung@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit f6eeab3032)
Cc: stable@vger.kernel.org
2025-11-26 12:31:26 -05:00
Alex Hung 3ce62c1896 drm/amd/display: Check NULL before accessing
[WHAT]
IGT kms_cursor_legacy's long-nonblocking-modeset-vs-cursor-atomic
fails with NULL pointer dereference. This can be reproduced with
both an eDP panel and a DP monitors connected.

 BUG: kernel NULL pointer dereference, address: 0000000000000000
 #PF: supervisor read access in kernel mode
 #PF: error_code(0x0000) - not-present page
 PGD 0 P4D 0
 Oops: Oops: 0000 [#1] SMP NOPTI
 CPU: 13 UID: 0 PID: 2960 Comm: kms_cursor_lega Not tainted
6.16.0-99-custom #8 PREEMPT(voluntary)
 Hardware name: AMD ........
 RIP: 0010:dc_stream_get_scanoutpos+0x34/0x130 [amdgpu]
 Code: 57 4d 89 c7 41 56 49 89 ce 41 55 49 89 d5 41 54 49
 89 fc 53 48 83 ec 18 48 8b 87 a0 64 00 00 48 89 75 d0 48 c7 c6 e0 41 30
 c2 <48> 8b 38 48 8b 9f 68 06 00 00 e8 8d d7 fd ff 31 c0 48 81 c3 e0 02
 RSP: 0018:ffffd0f3c2bd7608 EFLAGS: 00010292
 RAX: 0000000000000000 RBX: 0000000000000000 RCX: ffffd0f3c2bd7668
 RDX: ffffd0f3c2bd7664 RSI: ffffffffc23041e0 RDI: ffff8b32494b8000
 RBP: ffffd0f3c2bd7648 R08: ffffd0f3c2bd766c R09: ffffd0f3c2bd7760
 R10: ffffd0f3c2bd7820 R11: 0000000000000000 R12: ffff8b32494b8000
 R13: ffffd0f3c2bd7664 R14: ffffd0f3c2bd7668 R15: ffffd0f3c2bd766c
 FS:  000071f631b68700(0000) GS:ffff8b399f114000(0000)
knlGS:0000000000000000
 CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
 CR2: 0000000000000000 CR3: 00000001b8105000 CR4: 0000000000f50ef0
 PKRU: 55555554
 Call Trace:
 <TASK>
 dm_crtc_get_scanoutpos+0xd7/0x180 [amdgpu]
 amdgpu_display_get_crtc_scanoutpos+0x86/0x1c0 [amdgpu]
 ? __pfx_amdgpu_crtc_get_scanout_position+0x10/0x10[amdgpu]
 amdgpu_crtc_get_scanout_position+0x27/0x50 [amdgpu]
 drm_crtc_vblank_helper_get_vblank_timestamp_internal+0xf7/0x400
 drm_crtc_vblank_helper_get_vblank_timestamp+0x1c/0x30
 drm_crtc_get_last_vbltimestamp+0x55/0x90
 drm_crtc_next_vblank_start+0x45/0xa0
 drm_atomic_helper_wait_for_fences+0x81/0x1f0
 ...

Cc: Mario Limonciello <mario.limonciello@amd.com>
Cc: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Aurabindo Pillai <aurabindo.pillai@amd.com>
Signed-off-by: Alex Hung <alex.hung@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit 621e55f191)
Cc: stable@vger.kernel.org
2025-11-26 12:17:38 -05:00
Alex Deucher 3126c9ccb4 Revert "drm/amd/display: Move setup_stream_attribute"
This reverts commit 2681bf4ae8.

This results in a blank screen on the HDMI port on some systems.
Revert for now so as not to regress 6.18, can be addressed
in 6.19 once the issue is root caused.

Closes: https://gitlab.freedesktop.org/drm/amd/-/issues/4652
Cc: Sunpeng.Li@amd.com
Cc: ivan.lipski@amd.com
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit d0e9de7a81)
2025-11-26 12:16:58 -05:00
Harish Chegondi 7276878b06 drm/xe: Fix conversion from clock ticks to milliseconds
When tick counts are large and multiplication by MSEC_PER_SEC is larger
than 64 bits, the conversion from clock ticks to milliseconds can go bad.

Use mul_u64_u32_div() instead.

Cc: Ashutosh Dixit <ashutosh.dixit@intel.com>
Signed-off-by: Harish Chegondi <harish.chegondi@intel.com>
Suggested-by: Umesh Nerlige Ramappa <umesh.nerlige.ramappa@intel.com>
Fixes: 49cc215aad ("drm/xe: Add xe_gt_clock_interval_to_ms helper")
Reviewed-by: Ashutosh Dixit <ashutosh.dixit@intel.com>
Signed-off-by: Ashutosh Dixit <ashutosh.dixit@intel.com>
Link: https://patch.msgid.link/1562f1b62d5be3fbaee100f09107f3cc49e40dd1.1763408584.git.harish.chegondi@intel.com
(cherry picked from commit 96b93ac214f9dd66294d975d86c5dee256faef91)
Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
2025-11-25 11:53:34 -08:00
Lucas De Marchi 0e234632e3 drm/xe/guc: Fix stack_depot usage
Add missing stack_depot_init() call when CONFIG_DRM_XE_DEBUG_GUC is
enabled to fix the following call stack:

	[] BUG: kernel NULL pointer dereference, address: 0000000000000000
	[] Workqueue:  drm_sched_run_job_work [gpu_sched]
	[] RIP: 0010:stack_depot_save_flags+0x172/0x870
	[] Call Trace:
	[]  <TASK>
	[]  fast_req_track+0x58/0xb0 [xe]

Fixes: 16b7e65d29 ("drm/xe/guc: Track FAST_REQ H2Gs to report where errors came from")
Tested-by: Sagar Ghuge <sagar.ghuge@intel.com>
Cc: stable@vger.kernel.org # v6.17+
Reviewed-by: Stuart Summers <stuart.summers@intel.com>
Link: https://patch.msgid.link/20251118-fix-debug-guc-v1-1-9f780c6bedf8@intel.com
Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
(cherry picked from commit 64fdf496a6929a0a194387d2bb5efaf5da2b542f)
Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
2025-11-25 11:53:28 -08:00
Shuicheng Lin 76555b1eb2 drm/xe/guc: Fix resource leak in xe_guc_ct_init_noalloc()
xe_guc_ct_init_noalloc() allocates the CT workqueue and other helpers
before it tries to initialize ct->lock. If drmm_mutex_init() fails
we currently bail out without releasing those resources because the
guc_ct_fini() hasn’t been registered yet.

Since destroy_workqueue() in guc_ct_fini() may flush the workqueue, which
in turn can take the ct lock, the initialization sequence is restructured
to first initialize the ct->lock, then set up all CT state, and finally
register guc_ct_fini().

v2: guc_ct_fini() does take ct lock. (Matt)
v3: move primelockdep() together with drmm_mutex_init(). (Lucas)

Fixes: dd08ebf6c3 ("drm/xe: Introduce a new DRM driver for Intel GPUs")
Cc: Lucas De Marchi <lucas.demarchi@intel.com>
Cc: Matthew Brost <matthew.brost@intel.com>
Signed-off-by: Shuicheng Lin <shuicheng.lin@intel.com>
Reviewed-by: Lucas De Marchi <lucas.demarchi@intel.com>
Link: https://patch.msgid.link/20251110184522.1581001-2-shuicheng.lin@intel.com
Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
(cherry picked from commit 2e4ad5b0667244f496783c58de0995b9562d3344)
Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
2025-11-25 11:53:23 -08:00
Ville Syrjälä 7c373b3bd0
drm/i915/psr: Reject async flips when selective fetch is enabled
The selective fetch code doesn't handle asycn flips correctly.
There is a nonsense check for async flips in
intel_psr2_sel_fetch_config_valid() but that only gets called
for modesets/fastsets and thus does nothing for async flips.

Currently intel_async_flip_check_hw() is very unhappy as the
selective fetch code pulls in planes that are not even async
flips capable.

Reject async flips when selective fetch is enabled, until
someone fixes this properly (ie. disable selective fetch while
async flips are being issued).

Cc: stable@vger.kernel.org
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patch.msgid.link/20251105171015.22234-1-ville.syrjala@linux.intel.com
Reviewed-by: Jouni Högander <jouni.hogander@intel.com>
(cherry picked from commit a5f0cc8e0cd4007370af6985cb152001310cf20c)
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
2025-11-25 08:24:33 -05:00
Thomas Zimmermann eb76d0f555 drm, fbcon, vga_switcheroo: Avoid race condition in fbcon setup
Protect vga_switcheroo_client_fb_set() with console lock. Avoids OOB
access in fbcon_remap_all(). Without holding the console lock the call
races with switching outputs.

VGA switcheroo calls fbcon_remap_all() when switching clients. The fbcon
function uses struct fb_info.node, which is set by register_framebuffer().
As the fb-helper code currently sets up VGA switcheroo before registering
the framebuffer, the value of node is -1 and therefore not a legal value.
For example, fbcon uses the value within set_con2fb_map() [1] as an index
into an array.

Moving vga_switcheroo_client_fb_set() after register_framebuffer() can
result in VGA switching that does not switch fbcon correctly.

Therefore move vga_switcheroo_client_fb_set() under fbcon_fb_registered(),
which already holds the console lock. Fbdev calls fbcon_fb_registered()
from within register_framebuffer(). Serializes the helper with VGA
switcheroo's call to fbcon_remap_all().

Although vga_switcheroo_client_fb_set() takes an instance of struct fb_info
as parameter, it really only needs the contained fbcon state. Moving the
call to fbcon initialization is therefore cleaner than before. Only amdgpu,
i915, nouveau and radeon support vga_switcheroo. For all other drivers,
this change does nothing.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Link: https://elixir.bootlin.com/linux/v6.17/source/drivers/video/fbdev/core/fbcon.c#L2942 # [1]
Fixes: 6a9ee8af34 ("vga_switcheroo: initial implementation (v15)")
Acked-by: Javier Martinez Canillas <javierm@redhat.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Cc: dri-devel@lists.freedesktop.org
Cc: nouveau@lists.freedesktop.org
Cc: amd-gfx@lists.freedesktop.org
Cc: linux-fbdev@vger.kernel.org
Cc: <stable@vger.kernel.org> # v2.6.34+
Link: https://patch.msgid.link/20251105161549.98836-1-tzimmermann@suse.de
2025-11-25 09:08:32 +01:00
Marek Szyprowski 1a96f3a22f iommu/dma: add missing support for DMA_ATTR_MMIO for dma_iova_unlink()
Commit c288d657dd added support for DMA_ATTR_MMIO attribute in the
dma_iova_link() code path, but missed that the CPU cache is being also
touched in the dma_iova_unlink() path. Fix this.

Fixes: c288d657dd ("iommu/dma: implement DMA_ATTR_MMIO for dma_iova_link().")
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>
Reviewed-by: Leon Romanovsky <leon@kernel.org>
Link: https://lore.kernel.org/r/20251124170955.3884351-1-m.szyprowski@samsung.com
2025-11-24 22:15:11 +01:00
Michael Chen 971fb57429 drm/amd/amdgpu: reserve vm invalidation engine for uni_mes
Reserve vm invalidation engine 6 when uni_mes enabled. It
is used in processing tlb flush request from host.

Signed-off-by: Michael Chen <michael.chen@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Shaoyun liu <Shaoyun.liu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit 873373739b)
Cc: stable@vger.kernel.org
2025-11-24 13:25:31 -05:00
Johan Hovold 620a8f1311 drm: sti: fix device leaks at component probe
Make sure to drop the references taken to the vtg devices by
of_find_device_by_node() when looking up their driver data during
component probe.

Note that holding a reference to a platform device does not prevent its
driver data from going away so there is no point in keeping the
reference after the lookup helper returns.

Fixes: cc6b741c6f ("drm: sti: remove useless fields from vtg structure")
Cc: stable@vger.kernel.org	# 4.16
Cc: Benjamin Gaignard <benjamin.gaignard@collabora.com>
Signed-off-by: Johan Hovold <johan@kernel.org>
Link: https://patch.msgid.link/20250922122012.27407-1-johan@kernel.org
Signed-off-by: Raphael Gallais-Pou <raphael.gallais-pou@foss.st.com>
2025-11-24 13:56:16 +01:00
Matt Coster 83c53f1a2d
drm/imagination: Document pvr_device.power member
Automated testing caught this missing doc comment; add something suitable
(and useful).

Fixes: 330e76d316 ("drm/imagination: Add power domain control")
Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Closes: https://lore.kernel.org/r/20251106152448.453b53ad@canb.auug.org.au/
Reviewed-by: Alessio Belle <alessio.belle@imgtec.com>
Link: https://patch.msgid.link/20251121-device-power-doc-fix-v2-1-3417779f36c7@imgtec.com
Signed-off-by: Matt Coster <matt.coster@imgtec.com>
2025-11-21 17:06:11 +00:00
Devarsh Thakkar d6732ef4ab drm/bridge: sii902x: Fix HDMI detection with DRM_BRIDGE_ATTACH_NO_CONNECTOR
The sii902x driver was caching HDMI detection state in a sink_is_hdmi field
and checking it in mode_set() to determine whether to set HDMI or DVI
output mode. This approach had two problems:

1. With DRM_BRIDGE_ATTACH_NO_CONNECTOR (used by modern display drivers like
TIDSS), the bridge's get_modes() is never called. Instead, the
drm_bridge_connector helper calls the bridge's edid_read() and updates the
connector itself. This meant sink_is_hdmi was never populated, causing the
driver to default to DVI mode and breaking HDMI audio.

2. The mode_set() callback doesn't receive atomic state or connector
pointer, making it impossible to check connector->display_info.is_hdmi
directly at that point.

Fix this by moving the HDMI vs DVI decision from mode_set() to
atomic_enable(), where we can access the connector via
drm_atomic_get_new_connector_for_encoder(). This works for both connector
models:

- With DRM_BRIDGE_ATTACH_NO_CONNECTOR: Returns the drm_bridge_connector
  created by the display driver, which has already been updated by the
helper's call to drm_edid_connector_update()

- Without DRM_BRIDGE_ATTACH_NO_CONNECTOR (legacy): Returns the connector
  embedded in sii902x struct, which gets updated by the bridge's own
get_modes()

Fixes: 3de47e1309 ("drm/bridge: sii902x: use display info is_hdmi")
Signed-off-by: Devarsh Thakkar <devarsht@ti.com>
Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
Link: https://patch.msgid.link/20251030151635.3019864-1-devarsht@ti.com
2025-11-21 15:59:21 +01:00
23 changed files with 90 additions and 68 deletions

View File

@ -166,7 +166,7 @@ static int __acpi_processor_start(struct acpi_device *device)
if (result && !IS_ENABLED(CONFIG_ACPI_CPU_FREQ_PSS))
dev_dbg(&device->dev, "CPPC data invalid or not present\n");
if (cpuidle_get_driver() == &acpi_idle_driver)
if (!cpuidle_get_driver() || cpuidle_get_driver() == &acpi_idle_driver)
acpi_processor_power_init(pr);
acpi_pss_perf_init(pr);

View File

@ -2638,6 +2638,8 @@ static int amdgpu_device_parse_gpu_info_fw(struct amdgpu_device *adev)
chip_name = "navi12";
break;
case CHIP_CYAN_SKILLFISH:
if (adev->mman.discovery_bin)
return 0;
chip_name = "cyan_skillfish";
break;
}

View File

@ -597,6 +597,9 @@ int amdgpu_gmc_allocate_vm_inv_eng(struct amdgpu_device *adev)
/* reserve engine 5 for firmware */
if (adev->enable_mes)
vm_inv_engs[i] &= ~(1 << 5);
/* reserve engine 6 for uni mes */
if (adev->enable_uni_mes)
vm_inv_engs[i] &= ~(1 << 6);
/* reserve mmhub engine 3 for firmware */
if (adev->enable_umsch_mm)
vm_inv_engs[i] &= ~(1 << 3);

View File

@ -1066,7 +1066,7 @@ amdgpu_vm_tlb_flush(struct amdgpu_vm_update_params *params,
}
/* Prepare a TLB flush fence to be attached to PTs */
if (!params->unlocked && vm->is_compute_context) {
if (!params->unlocked) {
amdgpu_vm_tlb_fence_create(params->adev, vm, fence);
/* Makes sure no PD/PT is freed before the flush */

View File

@ -5052,6 +5052,21 @@ static void amdgpu_dm_backlight_set_level(struct amdgpu_display_manager *dm,
struct dc_link *link;
u32 brightness;
bool rc, reallow_idle = false;
struct drm_connector *connector;
list_for_each_entry(connector, &dm->ddev->mode_config.connector_list, head) {
struct amdgpu_dm_connector *aconnector = to_amdgpu_dm_connector(connector);
if (aconnector->bl_idx != bl_idx)
continue;
/* if connector is off, save the brightness for next time it's on */
if (!aconnector->base.encoder) {
dm->brightness[bl_idx] = user_brightness;
dm->actual_brightness[bl_idx] = 0;
return;
}
}
amdgpu_dm_update_backlight_caps(dm, bl_idx);
caps = &dm->backlight_caps[bl_idx];

View File

@ -997,8 +997,8 @@ enum dc_edid_status dm_helpers_read_local_edid(
struct amdgpu_dm_connector *aconnector = link->priv;
struct drm_connector *connector = &aconnector->base;
struct i2c_adapter *ddc;
int retry = 3;
enum dc_edid_status edid_status;
int retry = 25;
enum dc_edid_status edid_status = EDID_NO_RESPONSE;
const struct drm_edid *drm_edid;
const struct edid *edid;
@ -1028,7 +1028,7 @@ enum dc_edid_status dm_helpers_read_local_edid(
}
if (!drm_edid)
return EDID_NO_RESPONSE;
continue;
edid = drm_edid_raw(drm_edid); // FIXME: Get rid of drm_edid_raw()
if (!edid ||
@ -1046,7 +1046,7 @@ enum dc_edid_status dm_helpers_read_local_edid(
&sink->dc_edid,
&sink->edid_caps);
} while (edid_status == EDID_BAD_CHECKSUM && --retry > 0);
} while ((edid_status == EDID_BAD_CHECKSUM || edid_status == EDID_NO_RESPONSE) && --retry > 0);
if (edid_status != EDID_OK)
DRM_ERROR("EDID err: %d, on connector: %s",

View File

@ -705,9 +705,14 @@ bool dc_stream_get_scanoutpos(const struct dc_stream_state *stream,
{
uint8_t i;
bool ret = false;
struct dc *dc = stream->ctx->dc;
struct resource_context *res_ctx =
&dc->current_state->res_ctx;
struct dc *dc;
struct resource_context *res_ctx;
if (!stream->ctx)
return false;
dc = stream->ctx->dc;
res_ctx = &dc->current_state->res_ctx;
dc_exit_ips_for_hw_access(dc);

View File

@ -671,7 +671,6 @@ void dce110_enable_stream(struct pipe_ctx *pipe_ctx)
uint32_t early_control = 0;
struct timing_generator *tg = pipe_ctx->stream_res.tg;
link_hwss->setup_stream_attribute(pipe_ctx);
link_hwss->setup_stream_encoder(pipe_ctx);
dc->hwss.update_info_frame(pipe_ctx);

View File

@ -3060,8 +3060,6 @@ void dcn20_enable_stream(struct pipe_ctx *pipe_ctx)
link_enc->transmitter - TRANSMITTER_UNIPHY_A);
}
link_hwss->setup_stream_attribute(pipe_ctx);
if (dc->res_pool->dccg->funcs->set_pixel_rate_div)
dc->res_pool->dccg->funcs->set_pixel_rate_div(
dc->res_pool->dccg,

View File

@ -971,8 +971,6 @@ void dcn401_enable_stream(struct pipe_ctx *pipe_ctx)
}
}
link_hwss->setup_stream_attribute(pipe_ctx);
if (dc->res_pool->dccg->funcs->set_pixel_rate_div) {
dc->res_pool->dccg->funcs->set_pixel_rate_div(
dc->res_pool->dccg,

View File

@ -2458,6 +2458,7 @@ void link_set_dpms_on(
struct link_encoder *link_enc = pipe_ctx->link_res.dio_link_enc;
enum otg_out_mux_dest otg_out_dest = OUT_MUX_DIO;
struct vpg *vpg = pipe_ctx->stream_res.stream_enc->vpg;
const struct link_hwss *link_hwss = get_link_hwss(link, &pipe_ctx->link_res);
bool apply_edp_fast_boot_optimization =
pipe_ctx->stream->apply_edp_fast_boot_optimization;
@ -2502,6 +2503,8 @@ void link_set_dpms_on(
pipe_ctx->stream_res.tg->funcs->set_out_mux(pipe_ctx->stream_res.tg, otg_out_dest);
}
link_hwss->setup_stream_attribute(pipe_ctx);
pipe_ctx->stream->apply_edp_fast_boot_optimization = false;
// Enable VPG before building infoframe

View File

@ -44,11 +44,6 @@ static void virtual_stream_encoder_dvi_set_stream_attribute(
struct dc_crtc_timing *crtc_timing,
bool is_dual_link) {}
static void virtual_stream_encoder_lvds_set_stream_attribute(
struct stream_encoder *enc,
struct dc_crtc_timing *crtc_timing)
{}
static void virtual_stream_encoder_set_throttled_vcp_size(
struct stream_encoder *enc,
struct fixed31_32 avg_time_slots_per_mtp)
@ -120,8 +115,6 @@ static const struct stream_encoder_funcs virtual_str_enc_funcs = {
virtual_stream_encoder_hdmi_set_stream_attribute,
.dvi_set_stream_attribute =
virtual_stream_encoder_dvi_set_stream_attribute,
.lvds_set_stream_attribute =
virtual_stream_encoder_lvds_set_stream_attribute,
.set_throttled_vcp_size =
virtual_stream_encoder_set_throttled_vcp_size,
.update_hdmi_info_packets =

View File

@ -179,7 +179,6 @@ struct sii902x {
struct drm_connector connector;
struct gpio_desc *reset_gpio;
struct i2c_mux_core *i2cmux;
bool sink_is_hdmi;
u32 bus_width;
/*
@ -315,8 +314,6 @@ static int sii902x_get_modes(struct drm_connector *connector)
drm_edid_free(drm_edid);
}
sii902x->sink_is_hdmi = connector->display_info.is_hdmi;
return num;
}
@ -342,9 +339,17 @@ static void sii902x_bridge_atomic_enable(struct drm_bridge *bridge,
struct drm_atomic_state *state)
{
struct sii902x *sii902x = bridge_to_sii902x(bridge);
struct drm_connector *connector;
u8 output_mode = SII902X_SYS_CTRL_OUTPUT_DVI;
connector = drm_atomic_get_new_connector_for_encoder(state, bridge->encoder);
if (connector && connector->display_info.is_hdmi)
output_mode = SII902X_SYS_CTRL_OUTPUT_HDMI;
mutex_lock(&sii902x->mutex);
regmap_update_bits(sii902x->regmap, SII902X_SYS_CTRL_DATA,
SII902X_SYS_CTRL_OUTPUT_MODE, output_mode);
regmap_update_bits(sii902x->regmap, SII902X_PWR_STATE_CTRL,
SII902X_AVI_POWER_STATE_MSK,
SII902X_AVI_POWER_STATE_D(0));
@ -359,16 +364,12 @@ static void sii902x_bridge_mode_set(struct drm_bridge *bridge,
const struct drm_display_mode *adj)
{
struct sii902x *sii902x = bridge_to_sii902x(bridge);
u8 output_mode = SII902X_SYS_CTRL_OUTPUT_DVI;
struct regmap *regmap = sii902x->regmap;
u8 buf[HDMI_INFOFRAME_SIZE(AVI)];
struct hdmi_avi_infoframe frame;
u16 pixel_clock_10kHz = adj->clock / 10;
int ret;
if (sii902x->sink_is_hdmi)
output_mode = SII902X_SYS_CTRL_OUTPUT_HDMI;
buf[0] = pixel_clock_10kHz & 0xff;
buf[1] = pixel_clock_10kHz >> 8;
buf[2] = drm_mode_vrefresh(adj);
@ -384,11 +385,6 @@ static void sii902x_bridge_mode_set(struct drm_bridge *bridge,
mutex_lock(&sii902x->mutex);
ret = regmap_update_bits(sii902x->regmap, SII902X_SYS_CTRL_DATA,
SII902X_SYS_CTRL_OUTPUT_MODE, output_mode);
if (ret)
goto out;
ret = regmap_bulk_write(regmap, SII902X_TPI_VIDEO_DATA, buf, 10);
if (ret)
goto out;

View File

@ -31,9 +31,7 @@
#include <linux/console.h>
#include <linux/export.h>
#include <linux/pci.h>
#include <linux/sysrq.h>
#include <linux/vga_switcheroo.h>
#include <drm/drm_atomic.h>
#include <drm/drm_drv.h>
@ -566,11 +564,6 @@ EXPORT_SYMBOL(drm_fb_helper_release_info);
*/
void drm_fb_helper_unregister_info(struct drm_fb_helper *fb_helper)
{
struct fb_info *info = fb_helper->info;
struct device *dev = info->device;
if (dev_is_pci(dev))
vga_switcheroo_client_fb_set(to_pci_dev(dev), NULL);
unregister_framebuffer(fb_helper->info);
}
EXPORT_SYMBOL(drm_fb_helper_unregister_info);
@ -1632,7 +1625,6 @@ static int drm_fb_helper_single_fb_probe(struct drm_fb_helper *fb_helper)
struct drm_client_dev *client = &fb_helper->client;
struct drm_device *dev = fb_helper->dev;
struct drm_fb_helper_surface_size sizes;
struct fb_info *info;
int ret;
if (drm_WARN_ON(dev, !dev->driver->fbdev_probe))
@ -1653,12 +1645,6 @@ static int drm_fb_helper_single_fb_probe(struct drm_fb_helper *fb_helper)
strcpy(fb_helper->fb->comm, "[fbcon]");
info = fb_helper->info;
/* Set the fb info for vgaswitcheroo clients. Does nothing otherwise. */
if (dev_is_pci(info->device))
vga_switcheroo_client_fb_set(to_pci_dev(info->device), info);
return 0;
}

View File

@ -5964,6 +5964,14 @@ static int intel_async_flip_check_uapi(struct intel_atomic_state *state,
return -EINVAL;
}
/* FIXME: selective fetch should be disabled for async flips */
if (new_crtc_state->enable_psr2_sel_fetch) {
drm_dbg_kms(display->drm,
"[CRTC:%d:%s] async flip disallowed with PSR2 selective fetch\n",
crtc->base.base.id, crtc->base.name);
return -EINVAL;
}
for_each_oldnew_intel_plane_in_state(state, plane, old_plane_state,
new_plane_state, i) {
if (plane->pipe != crtc->pipe)

View File

@ -1256,12 +1256,6 @@ static bool intel_psr2_sel_fetch_config_valid(struct intel_dp *intel_dp,
return false;
}
if (crtc_state->uapi.async_flip) {
drm_dbg_kms(display->drm,
"PSR2 sel fetch not enabled, async flip enabled\n");
return false;
}
return crtc_state->enable_psr2_sel_fetch = true;
}

View File

@ -146,6 +146,14 @@ struct pvr_device {
*/
struct clk *mem_clk;
/**
* @power: Optional power domain devices.
*
* On platforms with more than one power domain for the GPU, they are
* stored here in @domain_devs, along with links between them in
* @domain_links. The size of @domain_devs is given by @domain_count,
* while the size of @domain_links is (2 * @domain_count) - 1.
*/
struct pvr_device_power {
struct device **domain_devs;
struct device_link **domain_links;

View File

@ -143,12 +143,17 @@ struct sti_vtg {
struct sti_vtg *of_vtg_find(struct device_node *np)
{
struct platform_device *pdev;
struct sti_vtg *vtg;
pdev = of_find_device_by_node(np);
if (!pdev)
return NULL;
return (struct sti_vtg *)platform_get_drvdata(pdev);
vtg = platform_get_drvdata(pdev);
put_device(&pdev->dev);
return vtg;
}
static void vtg_reset(struct sti_vtg *vtg)

View File

@ -93,11 +93,6 @@ int xe_gt_clock_init(struct xe_gt *gt)
return 0;
}
static u64 div_u64_roundup(u64 n, u32 d)
{
return div_u64(n + d - 1, d);
}
/**
* xe_gt_clock_interval_to_ms - Convert sampled GT clock ticks to msec
*
@ -108,5 +103,5 @@ static u64 div_u64_roundup(u64 n, u32 d)
*/
u64 xe_gt_clock_interval_to_ms(struct xe_gt *gt, u64 count)
{
return div_u64_roundup(count * MSEC_PER_SEC, gt->info.reference_clock);
return mul_u64_u32_div(count, MSEC_PER_SEC, gt->info.reference_clock);
}

View File

@ -226,6 +226,12 @@ int xe_guc_ct_init_noalloc(struct xe_guc_ct *ct)
xe_gt_assert(gt, !(guc_ct_size() % PAGE_SIZE));
err = drmm_mutex_init(&xe->drm, &ct->lock);
if (err)
return err;
primelockdep(ct);
ct->g2h_wq = alloc_ordered_workqueue("xe-g2h-wq", WQ_MEM_RECLAIM);
if (!ct->g2h_wq)
return -ENOMEM;
@ -237,16 +243,13 @@ int xe_guc_ct_init_noalloc(struct xe_guc_ct *ct)
#if IS_ENABLED(CONFIG_DRM_XE_DEBUG)
spin_lock_init(&ct->dead.lock);
INIT_WORK(&ct->dead.worker, ct_dead_worker_func);
#if IS_ENABLED(CONFIG_DRM_XE_DEBUG_GUC)
stack_depot_init();
#endif
#endif
init_waitqueue_head(&ct->wq);
init_waitqueue_head(&ct->g2h_fence_wq);
err = drmm_mutex_init(&xe->drm, &ct->lock);
if (err)
return err;
primelockdep(ct);
err = drmm_add_action_or_reset(&xe->drm, guc_ct_fini, ct);
if (err)
return err;

View File

@ -2008,7 +2008,7 @@ static void iommu_dma_iova_unlink_range_slow(struct device *dev,
end - addr, iovad->granule - iova_start_pad);
if (!dev_is_dma_coherent(dev) &&
!(attrs & DMA_ATTR_SKIP_CPU_SYNC))
!(attrs & (DMA_ATTR_SKIP_CPU_SYNC | DMA_ATTR_MMIO)))
arch_sync_dma_for_cpu(phys, len, dir);
swiotlb_tbl_unmap_single(dev, phys, len, dir, attrs);
@ -2032,7 +2032,8 @@ static void __iommu_dma_iova_unlink(struct device *dev,
size_t unmapped;
if ((state->__size & DMA_IOVA_USE_SWIOTLB) ||
(!dev_is_dma_coherent(dev) && !(attrs & DMA_ATTR_SKIP_CPU_SYNC)))
(!dev_is_dma_coherent(dev) &&
!(attrs & (DMA_ATTR_SKIP_CPU_SYNC | DMA_ATTR_MMIO))))
iommu_dma_iova_unlink_range_slow(dev, addr, size, dir, attrs);
iommu_iotlb_gather_init(&iotlb_gather);

View File

@ -66,6 +66,7 @@
#include <linux/string.h>
#include <linux/kd.h>
#include <linux/panic.h>
#include <linux/pci.h>
#include <linux/printk.h>
#include <linux/slab.h>
#include <linux/fb.h>
@ -78,6 +79,7 @@
#include <linux/interrupt.h>
#include <linux/crc32.h> /* For counting font checksums */
#include <linux/uaccess.h>
#include <linux/vga_switcheroo.h>
#include <asm/irq.h>
#include "fbcon.h"
@ -2899,6 +2901,9 @@ void fbcon_fb_unregistered(struct fb_info *info)
console_lock();
if (info->device && dev_is_pci(info->device))
vga_switcheroo_client_fb_set(to_pci_dev(info->device), NULL);
fbcon_registered_fb[info->node] = NULL;
fbcon_num_registered_fb--;
@ -3032,6 +3037,10 @@ static int do_fb_registered(struct fb_info *info)
}
}
/* Set the fb info for vga_switcheroo clients. Does nothing otherwise. */
if (info->device && dev_is_pci(info->device))
vga_switcheroo_client_fb_set(to_pci_dev(info->device), info);
return ret;
}

View File

@ -481,6 +481,7 @@ int dma_direct_map_sg(struct device *dev, struct scatterlist *sgl, int nents,
case PCI_P2PDMA_MAP_BUS_ADDR:
sg->dma_address = pci_p2pdma_bus_addr_map(&p2pdma_state,
sg_phys(sg));
sg_dma_len(sg) = sg->length;
sg_dma_mark_bus_address(sg);
continue;
default: