Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to Linux 6.7 drivers #332

Open
wants to merge 1,328 commits into
base: master
Choose a base branch
from

Conversation

dumbbell
Copy link
Member

@dumbbell dumbbell commented Jan 1, 2025

This is the backport of the DRM drivers from Linux 6.7.

Progress:

Changes in Linux 6.7

You can read this Phoronix article to learn about the changes in the DRM drivers in Linux 6.7:
https://www.phoronix.com/news/Linux-6.7-DRM-Graphics-Drivers

Patches to linuxkpi

This update depends on the following patches to linuxkpi in FreeBSD. They have not been submitted to Phabricator for review yet.

These patches are maintained in the following repository and branch:
https://github.com/dumbbell/freebsd-src/tree/drm-related-linuxkpi-changes

Patches were submitted for review:

Firmware updates

There is an associated firmware update:

How to test

You need to run a recent FreeBSD 15-CURRENT to test it.

Here are some instructions:

  1. You need to checkout the FreeBSD src branch I mentionned, linuxkpi-updates-for-drm, and compile a kernel from that branch:

    git clone -b drm-related-linuxkpi-changes https://github.com/dumbbell/freebsd-src.git
    cd freebsd-src
    make -j8 buildkernel DEBUG_FLAGS=-g
    
    # This installs the kernel under another name, `kernel.drm`. Thus, you keep the default kernel
    # in case of trouble.
    sudo make installkernel DEBUG_FLAGS=-g INSTKERNNAME=kernel.drm
  2. You need to checkout the branch referenced in this pull request and compile it:

    git clone -b update-to-linux-6.7 https://github.com/dumbbell/drm-kmod.git
    cd drm-kmod
    make -j8 DEBUG_FLAGS=-g SYSDIR=/path/to/freebsd-src-from-step1/sys
    sudo make install DEBUG_FLAGS=-g SYSDIR=/path/to/freebsd-src-from-step1/sys KMODDIR=/boot/kernel.drm
    
  3. Load the relevant driver(s) as you usually do.

@lin72h
Copy link

lin72h commented Jan 1, 2025

Does this mean I can use Intel external GPU? Thank you, as always, for improving the DRM stack.

@dumbbell
Copy link
Member Author

dumbbell commented Jan 1, 2025

I have no idea :-) Do you have a unit to test with?

I only test with an Intel 12th gen iGPU and a Radeon RX 6700 XT dGPU.

@lin72h
Copy link

lin72h commented Jan 2, 2025

@dumbbell Yes, I've ordered an A310 and a DG1 card. They should arrive in a few days. I'll test them and give you some feedback then.

@kenrap
Copy link

kenrap commented Jan 2, 2025

@wulf7 Would these updates add GUC/HUC support for DG2 cards?

@wulf7
Copy link
Contributor

wulf7 commented Jan 2, 2025

@wulf7 Would these updates add GUC/HUC support for DG2 cards?

Intel MEI and PXP drivers are still not ported

@wulf7
Copy link
Contributor

wulf7 commented Jan 2, 2025

Does this mean I can use Intel external GPU? Thank you, as always, for improving the DRM stack.

Probably vmmap_pfn() implementation is required. You may try patch from #315.
Unfortunatelly it didn't help for #315.

@emaste
Copy link
Member

emaste commented Jan 9, 2025

On a Dell Raptor Lake system the driver loads and I can start X but video is corrupted:
image
Zoomed in:
image

@lutzbichler
Copy link

Maybe we (still) need this? We have it in 6.6, but not in this PR.

intel_color.c.txt

@dumbbell
Copy link
Member Author

We don’t have this patch in the master branch (which is at 6.6). Where does this patch come from?

@emaste
Copy link
Member

emaste commented Jan 12, 2025

Maybe we (still) need this? We have it in 6.6, but not in this PR.

intel_color.c.txt

Yes that fixes it

@lutzbichler
Copy link

We don’t have this patch in the master branch (which is at 6.6). Where does this patch come from?

It is probably not the real fix to the problem, but the removal of:

/* FIXME DSB has issues loading LUTs, disable it for now */
return;

in intel_color_prepare_commit (737e4a7) is where I landed when I bisected (my attempt) to update to 6.7. So it seems the fix for Linux alone does not fix it for FreeBSD.

@emaste
Copy link
Member

emaste commented Jan 12, 2025

The FIXME comes from f327ba2 and was removed in 737e4a7

@emaste
Copy link
Member

emaste commented Jan 13, 2025

Panic on Framework Ultra 1 https://termbin.com/snmo

CPU: Intel(R) Core(TM) Ultra 5 125H (2995.20-MHz K8-class CPU)

drmn0: __drm_fb_helper_find_sizes: test CRTC 0 primary plane
drmn0: intelfb_create: no BIOS fb, allocating a new one
panic: Assertion base != 0 failed at /home/user/freebsd/sys/modules/drm-kmod/drivers/gpu/drm/drm_os_freebsd.c:86
cpuid = 6
time = 1736772151
KDB: stack backtrace:
db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame 0xfffffe010ac92490
vpanic() at vpanic+0x136/frame 0xfffffe010ac925c0
panic() at panic+0x43/frame 0xfffffe010ac92620
register_fictitious_range() at register_fictitious_range+0xc9/frame 0xfffffe010ac92650
intelfb_create() at intelfb_create+0x542/frame 0xfffffe010ac92760
__drm_fb_helper_initial_config_and_unlock() at __drm_fb_helper_initial_config_and_unlock+0x5b2/frame 0xfffffe010ac92800
intel_fbdev_initial_config_async() at intel_fbdev_initial_config_async+0x1a/frame 0xfffffe010ac92820
intel_display_driver_register() at intel_display_driver_register+0x63/frame 0xfffffe010ac92860
i915_driver_register() at i915_driver_register+0x65/frame 0xfffffe010ac92880
i915_driver_probe() at i915_driver_probe+0xb06/frame 0xfffffe010ac928c0
linux_pci_attach_device() at linux_pci_attach_device+0x43f/frame 0xfffffe010ac92910
device_attach() at device_attach+0x42b/frame 0xfffffe010ac92960
bus_generic_driver_added() at bus_generic_driver_added+0xa0/frame 0xfffffe010ac92980
devclass_driver_added() at devclass_driver_added+0x2f/frame 0xfffffe010ac929b0
devclass_add_driver() at devclass_add_driver+0x138/frame 0xfffffe010ac929f0
_linux_pci_register_driver() at _linux_pci_register_driver+0xc1/frame 0xfffffe010ac92a20
i915kms_evh() at i915kms_evh+0x28e/frame 0xfffffe010ac92a50
module_register_init() at module_register_init+0xb6/frame 0xfffffe010ac92a80
linker_load_module() at linker_load_module+0xc79/frame 0xfffffe010ac92d80
kern_kldload() at kern_kldload+0x16e/frame 0xfffffe010ac92dd0
sys_kldload() at sys_kldload+0x59/frame 0xfffffe010ac92e00
amd64_syscall() at amd64_syscall+0x163/frame 0xfffffe010ac92f30
fast_syscall_common() at fast_syscall_common+0xf8/frame 0xfffffe010ac92f30
--- syscall (304, FreeBSD ELF64, kldload), rip = 0x2acd570fbb9a, rsp = 0x2acd5417b6f8, rbp = 0x2acd5417bc70 ---

(For me the 6.6 port did not work on this machine, so no info on whether this is a regression.)

@lutzbichler
Copy link

Isn´t this the same as #324?

@emaste
Copy link
Member

emaste commented Jan 13, 2025

Isn´t this the same as #324?

It looks like it, yes - will test shortly.

@dumbbell
Copy link
Member Author

We don’t have this patch in the master branch (which is at 6.6). Where does this patch come from?

It is probably not the real fix to the problem, but the removal of:

/* FIXME DSB has issues loading LUTs, disable it for now */
return;

Ok, I see. I was looking for a FreeBSD-specific change and missed the fact that it was an upstream change. Thanks!

@emaste
Copy link
Member

emaste commented Jan 13, 2025

Isn´t this the same as #324?

Yes, it is the same issue; I've left a comment there. We need to implement some more functionality for Meteor Lake (MTL); I wonder if it would be possible to use the upstream routines more directly (other than drm-kmod being in ports).

@dumbbell
Copy link
Member Author

I resolved any diff with Linux 6.7, all committed in a single commit at the end of the branch. The associated freebsd-src branch was updated as the same time.

I will continue to use the branch as my daily driver with the amdgpu driver.

I will take some time to test the i915 driver too, it’s just that it is impractical: wifi does not work for me (Framework 13, Intel 12th gen) and with the laptop plugged into the dock, I break my neck to see the laptop’s screen :-)

@emaste
Copy link
Member

emaste commented Jan 14, 2025

Yes the patch in #324 avoids that panic, at the cost of display corruption while in the console (as mentioned there).

When trying to start X I get another panic:

...
WARNING: Device driver ttydev has set "memattr" inconsistently (drv 1 pmap 6).
WARNING: Device driver ttydev has set "memattr" inconsistently (drv 1 pmap 6).
WARNING: Device driver ttydev has set "memattr" inconsistently (drv 1 pmap 6).
WARNING: Device driver ttydev has set "memattr" inconsistently (drv 1 pmap 6).
WARNING: Device driver ttydev has set "memattr" inconsistently (drv 1 pmap 6).
panic: smr_entered_load: Assertion SMR_ENTERED((smr)) failed at /home/user/freebsd/sys/kern/subr_pctrie.c:146
cpuid = 3
time = 1736787411
KDB: stack backtrace:
db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame 0xfffffe0115fcaa70
vpanic() at vpanic+0x136/frame 0xfffffe0115fcaba0
panic() at panic+0x43/frame 0xfffffe0115fcac00
pctrie_lookup_unlocked() at pctrie_lookup_unlocked+0x12d/frame 0xfffffe0115fcac20
vm_page_lookup_unlocked() at vm_page_lookup_unlocked+0x14/frame 0xfffffe0115fcac30
vm_fault() at vm_fault+0xbdc/frame 0xfffffe0115fcad60
vm_fault_trap() at vm_fault_trap+0x65/frame 0xfffffe0115fcada0
trap_pfault() at trap_pfault+0x27b/frame 0xfffffe0115fcae10
trap() at trap+0x51e/frame 0xfffffe0115fcaf30
calltrap() at calltrap+0x8/frame 0xfffffe0115fcaf30
--- trap 0xc, rip = 0x8280b475a, rsp = 0x82128b838, rbp = 0x82128b8d0 ---
Uptime: 1m29s

@amshafer
Copy link
Contributor

This PR works for me as well on meteorlake, although I need the intel_color fix and the fix from #324 to do so.

Unfortunately it seems nothing can actually use the GPU because mesa can't query some device info bit from i915. I was hoping commit ada29e8 would improve things but it doesn't seem to. The error I get is:

% vkcube
MESA: warning: Could not get intel_device_info

I've been seeing this on the current master 6.6 update as well, so this isn't introduced by this PR but still figured I would mention it. Not sure if others see this working. This prevents me from testing anything real, sway, vkcube, etc all fail. It's something to do with Mesa's intel_get_device_info_from_fd() (eventually plumbing down to DRM_I915_QUERY_GEOMETRY_SUBSLICES iirc) not properly identifying the engines or something.

@evadot
Copy link
Contributor

evadot commented Jan 22, 2025

So, before updating drm-kmod more we should probably create a 6.6-lts branch, and for that we have to check if someone have the time to finish porting part of the i915 driver that's missing (don't remember which component are missing currently but @wulf7 knows).

@dumbbell
Copy link
Member Author

Last night, I pushed two changes:

  1. the fact that the GuC in the i915 driver is enabled if supported; this relies on a patch to linuxkpi, so be sure to update your kernel using my branch as well (see pull request description)
  2. an attempt to fix the registered fictitious range

Please give the latest commits a shot and report back :-)

finish porting part of the i915 driver that's missing

Oh, I wasn’t aware part of the driver was missing compared to earlier drm-kmod versions.

@emaste
Copy link
Member

emaste commented Jan 22, 2025

@evadot I don't see why there's a dependency as you imply -- we can create a 6.6 branch from master now, and any further work that's required can happen on the branch. 6.7 work can continue on master.

FWIW I have been running 6.6 on my daily driver Framework 11th gen Intel laptop for quite some time.

@dumbbell I brought the two changes into my branch and tried on two machines. Looks fine on 13-th gen Intel i5-1335U.

On the Framework Core Ultra 5 125H the panic is addressed but the video corruption in vt remains (as with #324):
image

Still panic upon starting X as mentioned above:
image

@evadot
Copy link
Contributor

evadot commented Jan 22, 2025

@evadot I don't see why there's a dependency as you imply -- we can create a 6.6 branch from master now, and any further work that's required can happen on the branch. 6.7 work can continue on master.

Because if we don't introduce IME and PXP in master before branching 6.6-lts I'm 100% sure that we will not have it in it. So the question is do we want to move forward now and introduce IME and PXP later or not.

@emaste
Copy link
Member

emaste commented Jan 22, 2025

IMO we cannot afford to wait on moving forward on support for contemporary hardware.

Nothing fundamentally prevents us from working on IME and PXP in master and merging work to 6.6-lts later on, does it?

@amshafer
Copy link
Contributor

Unfortunately both of these new commits seem to have issues for me. With the FB fix my machine seems to hang with a black screen now, reverting that and using my change from #324 resolves that. Unfortunately because it hangs I can't get a panic and see where it is actually going wrong. I'll keep playing with it and see if I can get any hints. If I had to guess I would guess that it does not fail during register_fictitious_range but fails after that due to something about the framebuffer, since the entire screen turns black.

The GuC enablement seems to fail:

Jan 23 00:54:34 token kernel: drmn1: [drm] GPU HANG: ecode 12:0:00000000
Jan 23 00:54:40 token syslogd: last message repeated 1 times
Jan 23 00:54:41 token kernel: drmn1: [drm] Got hung context on rcs'0 with active request 9:2 [0x1003] not yet started
Jan 23 00:54:41 token kernel: drmn1: [drm] GPU HANG: ecode 12:0:00000000

Here's the full log with DRM debugging fully enabled:
guc_fail.txt

It continued on a little more after this trying to reset the GPU since it saw bcs was hung as well.

kldload i915kms is stuck in the following stack while the hang shows in dmesg:

mi_switch+0x170 sleepq_switch+0x101 linux_add_to_sleepqueue+0xb2 linux_schedule_timeout+0x7b i915_request_wait_timeout+0x254 i915_request_wait+0x23 gen8_ggtt_bind_ptes+0x551 __gen8_ggtt_insert_entries_bind+0x118 gen8_ggtt_insert_entries_bind+0x54 intel_ggtt_bind_vma+0xb4 i915_vma_bind+0x348 i915_vma_pin_ww+0x4e3 __i915_ggtt_pin+0x57 i915_ggtt_pin+0x51 __context_pin_state+0x3c intel_context_pre_pin+0xb1 __intel_context_do_pin_ww+0x123 intel_context_pin_ww+0x47 

I am using the latest drm-related-linuxkpi-changes branch with the xa_destroy fix.

@dumbbell
Copy link
Member Author

Thank you @amshafer for the report! I will try to process that tonight.

Meanwhile, I worked last night on a fix for the following incorrect log messages in i915:

Jan 22 20:19:36 iss kernel: i915 display info: 0xfffffe01756967e0V<7>i915 display info: 0xfffffe01756967e0V<7>i915 display info: 0xfffffe01756967e0V<7>i915 display info: 0xfffffe01756967e0V<7>i915 display info: 0xfffffe01756967e0V<7>i915 display info: 0xfffffe01756967e0V<7>i915 display info: 0xfffffe01756967e0V<7>i915 display info: 0xfffffe01756967e0V<7>i915 display info: 0xfffffe01756967e0V<7>i915 display info: 0xfffffe01756967e0V<7>i915 display info: 0xfffffe01756967e0V<7>i915 display info: 0xfffffe01756967e0V<7>i915 display info: 0xfffffe01756967e0V<7>i915 display info: 0xfffffe01756967e0V<7>i915 display info: 0xfffffe01756967e0V<7>i915 display info: 0xfffffe01756967e0V<7>i915 display info: 0xfffffe01756967e0V<7>i915 display info: 0xfffffe01756967e0V<7>i915 display info: 0xfffffe01756967e0V<7>i915 display info: 0xfffffe0175696820V

Now it displays the correct messages:

Jan 23 10:06:57 iss kernel: i915 display info: display version: 13
Jan 23 10:06:57 iss kernel: i915 display info: cursor_needs_physical: no
Jan 23 10:06:57 iss kernel: i915 display info: has_cdclk_crawl: yes
Jan 23 10:06:57 iss kernel: i915 display info: has_cdclk_squash: no
Jan 23 10:06:57 iss kernel: i915 display info: has_ddi: yes
Jan 23 10:06:57 iss kernel: i915 display info: has_dp_mst: yes
Jan 23 10:06:57 iss kernel: i915 display info: has_dsb: yes
Jan 23 10:06:57 iss kernel: i915 display info: has_fpga_dbg: yes
Jan 23 10:06:57 iss kernel: i915 display info: has_gmch: no
Jan 23 10:06:57 iss kernel: i915 display info: has_hotplug: yes
Jan 23 10:06:57 iss kernel: i915 display info: has_hti: no
Jan 23 10:06:57 iss kernel: i915 display info: has_ipc: yes
Jan 23 10:06:57 iss kernel: i915 display info: has_overlay: no
Jan 23 10:06:57 iss kernel: i915 display info: has_psr: yes
Jan 23 10:06:57 iss kernel: i915 display info: has_psr_hw_tracking: no
Jan 23 10:06:57 iss kernel: i915 display info: overlay_needs_physical: no
Jan 23 10:06:57 iss kernel: i915 display info: supports_tv: no
Jan 23 10:06:57 iss kernel: i915 display info: has_hdcp: yes
Jan 23 10:06:57 iss kernel: i915 display info: has_dmc: yes
Jan 23 10:06:57 iss kernel: i915 display info: has_dsc: yes

This a change in freebsd-src but it’s not committed and pushed yet.

aknautiyal and others added 29 commits February 2, 2025 11:58
Currently we get bigjoiner config after the dsc get config, during HW
readout.
Since dsc_get_config now uses bigjoiner flags/pipes to compute DSC PPS
parameter pic_width, this results in a state mismatch when Bigjoiner
and DSC are used together.

So call get bigjoiner config before calling dsc get config function.

Fixes: 8b70b5691704 ("drm/i915/vdsc: Fill the intel_dsc_get_pps_config function")
Cc: Suraj Kandpal <[email protected]>
Cc: Ankit Nautiyal <[email protected]>
Cc: Animesh Manna <[email protected]>
Cc: Jani Nikula <[email protected]>

Signed-off-by: Ankit Nautiyal <[email protected]>
Reviewed-by: Suraj Kandpal <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
(cherry picked from commit baf31a20fa7f3538d68ffa5262a715eb1d699cdd)
Signed-off-by: Jani Nikula <[email protected]>
Updated i915 hwmon with fixes for issues reported by static analysis tool.
Fixed integer overflow with upcasting.

v2:
- Added Fixes tag (Badal).
- Updated commit message as per review comments (Anshuman).

Fixes: 4c2572fe0ae7 ("drm/i915/hwmon: Expose power1_max_interval")
Reviewed-by: Badal Nilawar <[email protected]>
Reviewed-by: Anshuman Gupta <[email protected]>
Signed-off-by: Karthik Poosa <[email protected]>
Signed-off-by: Anshuman Gupta <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
(cherry picked from commit ac3420d3d428443a08b923f9118121c170192b62)
Signed-off-by: Jani Nikula <[email protected]>
Currently async flips are busted when bigjoiner is in use.
As a short term fix simply reject async flips in that case.

Cc: [email protected]
Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/9769
Signed-off-by: Ville Syrjälä <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
Reviewed-by: Stanislav Lisovskiy <[email protected]>
(cherry picked from commit e93bffc2ac0a833b42841f31fff955549d38ce98)
Signed-off-by: Jani Nikula <[email protected]>
Select the HDMI specific PLL clock only for HDMI outputs.

Fixes: 62618c7f117e ("drm/i915/mtl: C20 PLL programming")
Cc: Mika Kahola <[email protected]>
Cc: Radhakrishna Sripada <[email protected]>
Reviewed-by: Radhakrishna Sripada <[email protected]>
Signed-off-by: Imre Deak <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
(cherry picked from commit 937d02cc79c6828fef28a4d80d8d0ad2f7bf2b62)
Signed-off-by: Jani Nikula <[email protected]>
The pipe DMC seems to be making a mess of things in ADL. Various weird
symptoms have been observed such as missing vblank irqs, typicalle
happening when using multiple displays.

Keep all pipe DMC event handlers disabled until needed (which is never
atm). This is also what Windows does on ADL+.

We can also drop DG2 from disable_all_flip_queue_events() since
on DG2 the pipe DMC is the one that handles the flip queue events.

Cc: [email protected]
Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/8685
Signed-off-by: Ville Syrjälä <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
Reviewed-by: Imre Deak <[email protected]>
(cherry picked from commit 648d7be8ecf47b0556e32550145c70db153b16fb)
Signed-off-by: Jani Nikula <[email protected]>
…vram table 3.0"

[Description]
Revert commit fec05adc40c2 ("drm/amd/display: Use channel_width = 2 for vram table 3.0")
Because the issue is being fixed from VBIOS side.

Reviewed-by: Samson Tam <[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]>
There have recently been changes that break backwards compatibility,
that were introduced into DMUB firmware (for DCN32x) concerning FPO and
SubVP. So, since those are just power optimization features, we can just
disable them unless the user is using a new enough version of DMUB
firmware.

Cc: [email protected]
Link: https://gitlab.freedesktop.org/drm/amd/-/issues/2870
Fixes: ed6e2782e974 ("drm/amd/display: For cursor P-State allow for SubVP")
Reported-by: Mikhail Gavrilov <[email protected]>
Closes: https://lore.kernel.org/r/CABXGCsNRb0QbF2pKLJMDhVOKxyGD6-E+8p-4QO6FOWa6zp22_A@mail.gmail.com/
Reviewed-by: Harry Wentland <[email protected]>
Signed-off-by: Hamza Mahfooz <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
[Why & how]
Refactor dc_is_dmub_outbox_supported() a bit and add case for dcn35 to
register dmub outbox notification irq to handle usb4 relevant hpd event.

Reviewed-by: Roman Li <[email protected]>
Reviewed-by: Jun Lei <[email protected]>
Signed-off-by: Wayne Lin <[email protected]>
Tested-by: Daniel Wheeler <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
[why & how]
we have two SSC_En:
we get ssc_info from dce_info for MPLL_SSC_EN.
we used to call VBIOS cmdtbl's smu_info's SS persentage for DPRECLK SS info,
is used for DP AUDIO and VBIOS' smu_info table was from systemIntegrationInfoTable.

since dcn35 VBIOS removed smu_info, driver need to use integrationInfotable directly.

Reviewed-by: Nicholas Kazlauskas <[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]>
[Why]
Driver incorrectly checks if pointer variable OutBpp is null instead of
if the value being pointed to is zero.

[How]
Dereference OutBpp before checking for a value of zero.

Reviewed-by: Chaitanya Dhere <[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]>
Idle bo's PTE needs to be re-created when resetting VM state machine.
Set idle bo's vm_bo as moved to mark it as invalid.

Fixes: 55bf196f60df ("drm/amdgpu: reset VM when an error is detected")
Signed-off-by: ZhenGuo Yin <[email protected]>
Reviewed-by: Christian König <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
…_pattern

Using link_status to get DPCD_REV fails when disabling/defaulting
phy pattern. Use intel_dp->dpcd to access DPCD_REV correctly.

Fixes: 8cdf72711928 ("drm/i915/dp: Program vswing, pre-emphasis, test-pattern")
Cc: Jani Nikula <[email protected]>
Cc: Imre Deak <[email protected]>
Cc: Lee Shawn C <[email protected]>
Signed-off-by: Khaled Almahallawy <[email protected]>
Signed-off-by: Jani Nikula <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
(cherry picked from commit 3ee302ec22d6e1d7d1e6d381b0d507ee80f2135c)
On XEHP platforms user is not able to find MMIO triggered reports in the
OA buffer since i915 squashes the context ID fields. These context ID
fields hold the MMIO trigger markers.

Update logic to not squash the context ID fields of MMIO triggered
reports.

Fixes: cba94bbcff08 ("drm/i915/perf: Determine context valid in OA reports")
Signed-off-by: Umesh Nerlige Ramappa <[email protected]>
Reviewed-by: Ashutosh Dixit <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
(cherry picked from commit 0c68132df6e66244acec1bb5b9e19b0751414389)
Signed-off-by: Jani Nikula <[email protected]>
link_rate sometime will be changed when DP MST connector hotplug, so
pbn_div also need be updated; otherwise, it will mismatch with
link_rate, causes no output in external monitor.

This is a backport to 6.7 and older.

Cc: [email protected]
Tested-by: Daniel Wheeler <[email protected]>
Reviewed-by: Jerry Zuo <[email protected]>
Acked-by: Rodrigo Siqueira <[email protected]>
Signed-off-by: Wade Wang <[email protected]>
Signed-off-by: Wayne Lin <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
Use separate metric table for APU and Non APU
systems for smu_v_13_0_6 to get metric data

Signed-off-by: Asad Kamal <[email protected]>
Reviewed-by: Lijo Lazar <[email protected]>
Reviewed-by: Le Ma <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
Update pmfw metric table to include vcn & jpeg
activity for smu_v_13_0_6

Signed-off-by: Asad Kamal <[email protected]>
Reviewed-by: Lijo Lazar <[email protected]>
Reviewed-by: Le Ma <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
This was included in gpu_info firmware, move it into the
driver for consistency with other nv1x parts.

Link: https://gitlab.freedesktop.org/drm/amd/-/issues/2318
Reviewed-by: Hawking Zhang <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
Cc: [email protected]
…isplays without PSR

The check for sending the vsc infopacket to the display was gated behind
PSR (Panel Self Refresh) being enabled.

The vsc infopacket also contains the colorimetry (specifically the
container color gamut) information for the stream on modern DP.

PSR is typically only supported on mobile phone eDP displays, thus this
was not getting sent for typical desktop monitors or TV screens.

This functionality is needed for proper HDR10 functionality on DP as it
wants BT2020 RGB/YCbCr for the container color space.

Cc: [email protected]
Cc: Harry Wentland <[email protected]>
Cc: Xaver Hugl <[email protected]>
Cc: Melissa Wen <[email protected]>
Fixes: 15f9dfd545a1 ("drm/amd/display: Register Colorspace property for DP and HDMI")
Tested-by: Simon Berz <[email protected]>
Tested-by: Xaver Hugl <[email protected]>
Signed-off-by: Joshua Ashton <[email protected]>
Signed-off-by: Hamza Mahfooz <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
Expose sysfs entry mem_busy_percent for GC version
9.4.3 APU system

Signed-off-by: Asad Kamal <[email protected]>
Reviewed-by: Lijo Lazar <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
Add new gpu_metrics_v1_5 to acquire vcn/jpeg activity
& pcie nak error counters

Signed-off-by: Asad Kamal <[email protected]>
Reviewed-by: Lijo Lazar <[email protected]>
Reviewed-by: Le Ma <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
Use gpu_metrics_v1_5 for SMUv13.0.6 to fill
gpu metric info

Signed-off-by: Asad Kamal <[email protected]>
Reviewed-by: Lijo Lazar <[email protected]>
Reviewed-by: Le Ma <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
Use managed memory allocation for this. That allows us to not keep
track of all the files any more.

v2: keep drm_debugfs_cleanup(), but rename to drm_debugfs_unregister(),
    we still need to cleanup the symlink

Signed-off-by: Christian König <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
Reviewed-by: Andi Shyti <[email protected]>
Remove a few hidden compound_head() calls by converting the returned page
to a folio once and using the folio APIs.

Link: https://lkml.kernel.org/r/[email protected]
Signed-off-by: Matthew Wilcox (Oracle) <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
If the shared memory object is larger than the DRM object that it backs,
we can overrun the page array.  Limit the number of pages we install
from each folio to prevent this.

Signed-off-by: "Matthew Wilcox (Oracle)" <[email protected]>
Reported-by: Oleksandr Natalenko <[email protected]>
Tested-by: Oleksandr Natalenko <[email protected]>
Link: https://lore.kernel.org/lkml/[email protected]/
Fixes: 3291e09a4638 ("drm: convert drm_gem_put_pages() to use a folio_batch")
Cc: [email protected] # 6.5.x
Signed-off-by: Maxime Ripard <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
Remove one of the last remaining users of pagevec.

Link: https://lkml.kernel.org/r/[email protected]
Signed-off-by: Matthew Wilcox (Oracle) <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Differences were reviewed using e.g.:

    diff -Nau -pX scripts/diffignore \
      drm-kmod/drivers/gpu/drm/ \
      linux/drivers/gpu/drm/

    diff -Naur -pX scripts/diffignore \
      drm-kmod/drivers/gpu/drm/amd/amdgpu/ \
      linux/drivers/gpu/drm/amd/amdgpu/

    diff -Naur -pX scripts/diffignore \
      drm-kmod/drivers/gpu/drm/i915/ \
      linux/drivers/gpu/drm/i915/

    diff -Naur -pX scripts/diffignore \
      drm-kmod/include/drm/ \
      linux/include/drm/
[Why]
This now possible after the following fix in FreeBSD src's linuxkpi:

    linuxkpi: Don't destroy the mutex in `xa_destroy()`
… range

[Why]
When the code was adapted to use the new vt_drmfb integration, the i915
driver continued to use the values that used to be stored in
`info->apertures->ranges[0]`.

However they might be incorrect and in fact zero.

[How]
Instead, use the `info->fix.smem_*` values to register the fictitious
range. These are the values by vt_drmfb later.
@dumbbell dumbbell force-pushed the update-to-linux-6.7 branch from 9f6a07b to a0088f2 Compare February 2, 2025 10:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.