platform/kernel/linux-rpi.git
18 months agoMerge tag 'drm-intel-next-2023-01-12' of git://anongit.freedesktop.org/drm/drm-intel...
Dave Airlie [Mon, 16 Jan 2023 19:23:07 +0000 (05:23 +1000)]
Merge tag 'drm-intel-next-2023-01-12' of git://anongit.freedesktop.org/drm/drm-intel into drm-next

drm/i915 feature pull #1 for v6.3:

Features and functionality:
- Meteorlake display enabling (Animesh, Luca, Stan, Jouni, Anusha)
- DP MST DSC support (Stan)
- Gamma/degamma readout support for the state checker (Ville)
- Enable SDP split support for DP 2.0 (Vinod)
- Add probe blocking support to i915.force_probe parameter (Rodrigo)
- Enable Xe HP 4tile support (Jonathan)

Refactoring and cleanups:
- Color refactoring, especially related to DSB usage (Ville)
- DSB refactoring (Ville)
- DVO refactoring (Ville)
- Backlight register and logging cleanups (Jani)
- Avoid display direct calls to uncore (Maarten, Jani)
- Add new "soc" sub-directory (Jani)
- Refactor DSC platform support checks (Swati)

Fixes:
- Interlace modes are no longer supported starting at display version 12 (Ankit)
- Use polling read for aux control (Arun)
- DMC firmware no longer requires specific versions (Gustavo)
- Fix PSR flickering and freeze issues (Jouni)
- Fix ICL+ DSI GPIO handling (Jani)
- Ratelimit errors in display engine irqs (Lucas)
- Fix DP MST DSC bpp and timeslot calculations (Stan)
- Fix CDCLK squash and crawl sequences (Ville, Anusha)
- Fix bigjoiner checks for fused pipes (Ville)
- Fix ADP+ degamma LUT size (Ville)
- Fix DVO ch7xxx and sil164 suspend/resume (Ville)
- Fix memory leak in VBT parsing (Xia Fukun)
- Fix VBT packet port selection for dual link DSI (Mikko Kovanen)
- Fix SDP infoframe product string for discrete graphics (Clint)
- Fix VLV/CHV HDMI/DP audio enable (Ville)
- Fix VRR delays and calculations (Ville)
- No longer disable transcoder for PHY test pattern change (Khaled)
- Fix dual PPS handling (Ville)
- Fix timeout and wait for DDI BUF CTL active after enabling (Ankit)

Merges:
- Backmerge drm-next to sync up with v6.2-rc1 (Jani)

Signed-off-by: Dave Airlie <airlied@redhat.com>
From: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/87tu0wez34.fsf@intel.com
18 months agoMerge tag 'drm-misc-next-2023-01-12' of git://anongit.freedesktop.org/drm/drm-misc...
Dave Airlie [Mon, 16 Jan 2023 05:33:22 +0000 (15:33 +1000)]
Merge tag 'drm-misc-next-2023-01-12' of git://anongit.freedesktop.org/drm/drm-misc into drm-next

drm-misc-next for v6.3:

UAPI Changes:

 * fourcc: Document Open Source user waiver

Cross-subsystem Changes:

 * firmware: fix color-format selection for system framebuffers

Core Changes:

 * format-helper: Add conversion from XRGB8888 to various sysfb formats;
   Make XRGB8888 the only driver-emulated legacy format

 * fb-helper: Avoid blank consoles from selecting an incorrect color format

 * probe-helper: Enable/disable HPD on connectors plus driver updates

 * Use drm_dbg_ helpers in several places

 * docs: Document defaults for CRTC backgrounds; Document use of drm_minor

Driver Changes:

 * arm/hdlcd: Use new debugfs helpers

 * gud: Use new debugfs helpers

 * panel: Support Visionox VTDR6130 AMOLED DSI; Support Himax HX8394; Convert
   many drivers to common generic DSI write-sequence helper

 * v3d: Do not opencode drm_gem_object_lookup()

 * vc4: Various HVS an CRTC fixes

 * vkms: Fix SEGFAULT from incorrect GEM-buffer mapping

 * Convert various drivers to i2c probe_new()

Signed-off-by: Dave Airlie <airlied@redhat.com>
From: Thomas Zimmermann <tzimmermann@suse.de>
Link: https://patchwork.freedesktop.org/patch/msgid/Y8ADeSzZDj+tpibF@linux-uq9g
18 months agoMerge tag 'amd-drm-next-6.3-2023-01-13' of https://gitlab.freedesktop.org/agd5f/linux...
Dave Airlie [Mon, 16 Jan 2023 05:04:12 +0000 (15:04 +1000)]
Merge tag 'amd-drm-next-6.3-2023-01-13' of https://gitlab.freedesktop.org/agd5f/linux into drm-next

amd-drm-next-6.3-2023-01-13:

amdgpu:
- Fix possible segfault in failure case
- Rework FW requests to happen in early_init for all IPs so
  that we don't lose the sbios console if FW is missing
- PSR fixes
- Misc cleanups
- Unload fix
- SMU13 fixes

amdkfd:
- Fix for cleared VRAM BOs
- Fix cleanup if GPUVM creation fails
- Memory accounting fix
- Use resource_size rather than open codeing it
- GC11 mGPU fix

radeon:
- Fix memory leak on shutdown

Signed-off-by: Dave Airlie <airlied@redhat.com>
From: Alex Deucher <alexander.deucher@amd.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20230113225911.7776-1-alexander.deucher@amd.com
18 months agoMerge tag 'amd-drm-next-6.3-2023-01-06' of https://gitlab.freedesktop.org/agd5f/linux...
Dave Airlie [Mon, 16 Jan 2023 04:00:12 +0000 (14:00 +1000)]
Merge tag 'amd-drm-next-6.3-2023-01-06' of https://gitlab.freedesktop.org/agd5f/linux into drm-next

amd-drm-next-6.3-2023-01-06:

amdgpu:
- secure display support for multiple displays
- DML optimizations
- DCN 3.2 updates
- PSR updates
- DP 2.1 updates
- SR-IOV RAS updates
- VCN RAS support
- SMU 13.x updates
- Switch 1 element arrays to flexible arrays
- Add RAS support for DF 4.3
- Stack size improvements
- S0ix rework
- Soft reset fix
- Allow 0 as a vram limit on APUs
- Display fixes
- Misc code cleanups
- Documentation fixes
- Handle profiling modes for SMU13.x

amdkfd:
- Error handling fixes
- PASID fixes

radeon:
- Switch 1 element arrays to flexible arrays

drm:
- Add DP adaptive sync DPCD definitions

UAPI:
- Add new INFO queries for peak and min sclk/mclk for profile modes on newer chips
  Proposed mesa patch: https://gitlab.freedesktop.org/mesa/drm/-/merge_requests/278

Signed-off-by: Dave Airlie <airlied@redhat.com>
From: Alex Deucher <alexander.deucher@amd.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20230106222037.7870-1-alexander.deucher@amd.com
18 months agodrm/vkms: reintroduce prepare_fb and cleanup_fb functions
Maíra Canal [Wed, 11 Jan 2023 13:13:05 +0000 (10:13 -0300)]
drm/vkms: reintroduce prepare_fb and cleanup_fb functions

With commit 359c6649cd9a ("drm/gem: Implement shadow-plane {begin,
end}_fb_access with vmap"), the behavior of the shadow-plane helpers
changed and the vunmap is now performed at the end of
the current pageflip, instead of the end of the following pageflip.

By performing the vunmap at the end of the current pageflip, invalid
memory is accessed by the vkms during the plane composition, as the data
is being unmapped before being used, as reported by the following
warning:

 [  275.866047] BUG: unable to handle page fault for address: ffffb382814e8002
 [  275.866055] #PF: supervisor read access in kernel mode
 [  275.866058] #PF: error_code(0x0000) - not-present page
 [  275.866061] PGD 1000067 P4D 1000067 PUD 110a067 PMD 46e3067 PTE 0
 [  275.866066] Oops: 0000 [#1] PREEMPT SMP PTI
 [  275.866070] CPU: 2 PID: 49 Comm: kworker/u8:2 Not tainted 6.1.0-rc6-00018-gb357e7ac1b73-dirty #54
 [  275.866074] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.16.1-2.fc37 04/01/2014
 [  275.866076] Workqueue: vkms_composer vkms_composer_worker [vkms]
 [  275.866084] RIP: 0010:XRGB8888_to_argb_u16+0x5c/0xa0 [vkms]
 [  275.866092] Code: bf 56 0a 0f af 56 70 48 8b 76 28 01 ca 49 83 f8 02
 41 b9 01 00 00 00 4d 0f 43 c8 48 01 f2 48 83 c2 02 31 f6 66 c7 04 f0 ff
 ff <0f> b6 0c b2 89 cf c1 e7 08 09 cf 66 89 7c f0 02 0f b6 4c b2 ff 89
 [  275.866095] RSP: 0018:ffffb382801b7db0 EFLAGS: 00010246
 [  275.866098] RAX: ffff896336ace000 RBX: ffff896310e293c0 RCX: 0000000000000000
 [  275.866101] RDX: ffffb382814e8002 RSI: 0000000000000000 RDI: ffffb382801b7de8
 [  275.866103] RBP: 0000000000001400 R08: 0000000000000280 R09: 0000000000000280
 [  275.866105] R10: 0000000000000010 R11: ffffffffc011d990 R12: ffff896302a1ece0
 [  275.866107] R13: 0000000000000000 R14: 0000000000000000 R15: 0000000080008001
 [  275.866109] FS:  0000000000000000(0000) GS:ffff89637dd00000(0000) knlGS:0000000000000000
 [  275.866112] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
 [  275.866114] CR2: ffffb382814e8002 CR3: 0000000003bb4000 CR4: 00000000000006e0
 [  275.866120] Call Trace:
 [  275.866123]  <TASK>
 [  275.866124]  compose_active_planes+0x1c4/0x380 [vkms]
 [  275.866132]  vkms_composer_worker+0x9f/0x130 [vkms]
 [  275.866139]  process_one_work+0x1c0/0x370
 [  275.866160]  worker_thread+0x221/0x410
 [  275.866164]  ? worker_clr_flags+0x50/0x50
 [  275.866167]  kthread+0xe1/0x100
 [  275.866172]  ? kthread_blkcg+0x30/0x30
 [  275.866176]  ret_from_fork+0x22/0x30
 [  275.866181]  </TASK>
 [  275.866182] Modules linked in: vkms
 [  275.866186] CR2: ffffb382814e8002
 [  275.866191] ---[ end trace 0000000000000000 ]---

Therefore, introduce again prepare_fb and cleanup_fb functions to the
vkms, which were previously removed on commit b43e2ec03b0d ("drm/vkms:
Let shadow-plane helpers prepare the plane's FB").

Fixes: 359c6649cd9a ("drm/gem: Implement shadow-plane {begin, end}_fb_access with vmap")
Acked-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Maíra Canal <mcanal@igalia.com>
Signed-off-by: Melissa Wen <melissa.srw@gmail.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20230111131304.106039-1-mcanal@igalia.com
18 months agodrm/i915/display: Prune Interlace modes for Display >=12
Ankit Nautiyal [Thu, 5 Jan 2023 12:41:25 +0000 (18:11 +0530)]
drm/i915/display: Prune Interlace modes for Display >=12

Defeature Display Interlace support.
Support for interlace modes is removed from Gen 12 onwards.
Pruning the interlace modes for HDMI for Display >=12.
Bspec: 50490

v2: Add check for both DP and HDMI. (Ville)
Get rid of redundant check for interlace mode in modevalid. (Ville)

v3: Simplify the condition to avoid interlace modes. (Jani)

Signed-off-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
Signed-off-by: Uma Shankar <uma.shankar@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20230105124125.1129653-1-ankit.k.nautiyal@intel.com
18 months agodrm/i915/display: Drop check for doublescan mode in modevalid
Ankit Nautiyal [Mon, 17 Oct 2022 14:30:37 +0000 (20:00 +0530)]
drm/i915/display: Drop check for doublescan mode in modevalid

Since the DP/HDMI connector do not set connector->doublescan_allowed,
the doublescan modes will get automatically filtered during
drm_helper_probe_single_connector_modes().

Therefore check for double scan modes is not required and is dropped
from modevalid functions for both DP and HDMI.

Signed-off-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
Signed-off-by: Uma Shankar <uma.shankar@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20221017143038.1748319-2-ankit.k.nautiyal@intel.com
18 months agodrm: document better that drivers shouldn't use drm_minor directly
Daniel Vetter [Mon, 9 Jan 2023 16:46:04 +0000 (17:46 +0100)]
drm: document better that drivers shouldn't use drm_minor directly

The documentation for struct drm_minor already states this, but that's
not always that easy to find.

Also due to historical reasons we still have the minor-centric
interfaces (like drm_debugfs_create_files), but since this is now
getting fixed we can put a few more pointers in place as to how this
should be done ideally. Note that debugfs isn't there yet for all
cases (debugfs files on kms objects like crtc/connector aren't
supported, neither debugfs files with full fops), so the debugfs side
of this is still rather aspirational and more for new users than
converting everything existing. todo.rst covers the additional work
needed already.

Motivated by some discussion with Rodrigo on irc about how drm/xe
should lay out its sysfs interfaces.

v2: Make the debugfs situation clearer in the commit message, but
don't elaborate more in the actual kerneldoc to avoid distracting from
the main message around sysfs (Jani)

Also fix some typos.

Acked-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Reviewed-by: Melissa Wen <mwen@igalia.com>
Reviewed-by: Maíra Canal <mcanal@igalia.com>
Acked-by: Maxime Ripard <maxime@cerno.tech>
Acked-by: Jani Nikula <jani.nikula@linux.intel.com>
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
Cc: Wambui Karuga <wambui.karugax@gmail.com>
Cc: Maíra Canal <mcanal@igalia.com>
Cc: Maxime Ripard <maxime@cerno.tech>
Cc: Melissa Wen <mwen@igalia.com>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20230109164604.3860862-1-daniel.vetter@ffwll.ch
18 months agodrm/amdkfd: Page aligned memory reserve size
Philip Yang [Mon, 9 Jan 2023 23:08:17 +0000 (18:08 -0500)]
drm/amdkfd: Page aligned memory reserve size

Use page aligned size to reserve memory usage because page aligned TTM
BO size is used to unreserve memory usage, otherwise no page aligned
size causes memory usage accounting unbalanced.

Change vram_used definition type to int64_t to be able to trigger
WARN_ONCE(adev && adev->kfd.vram_used < 0, "..."), to help debug the
accounting issue with warning and backtrace.

Signed-off-by: Philip Yang <Philip.Yang@amd.com>
Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
18 months agodrm/amdkfd: Cleanup vm process info if init vm failed
Philip Yang [Tue, 20 Dec 2022 19:55:03 +0000 (14:55 -0500)]
drm/amdkfd: Cleanup vm process info if init vm failed

If acquire_vm failed when initializing KFD vm, set vm->process_info to
NULL and free process info, otherwise, the future acquire_vm will
always fail as vm->process_info is not NULL.

Pass avm as parameter to remove the duplicate code.

Signed-off-by: Philip Yang <Philip.Yang@amd.com>
Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
18 months agodrm/panel-xinpeng-xpp055c272: Drop custom DSI write macro
Javier Martinez Canillas [Sat, 7 Jan 2023 19:18:22 +0000 (20:18 +0100)]
drm/panel-xinpeng-xpp055c272: Drop custom DSI write macro

There is a macro for this already in the <drm/drm_mipi_dsi.h> header, use
that instead and delete the custom DSI write macro defined in the driver.

Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
Reviewed-by: Sam Ravnborg <sam@ravnborg.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20230107191822.3787147-14-javierm@redhat.com
18 months agodrm/panel-sony-tulip-truly-nt35521: Drop custom DSI write macro
Javier Martinez Canillas [Sat, 7 Jan 2023 19:18:21 +0000 (20:18 +0100)]
drm/panel-sony-tulip-truly-nt35521: Drop custom DSI write macro

There is a macro for this already in the <drm/drm_mipi_dsi.h> header, use
that instead and delete the custom DSI write macro defined in the driver.

Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
Reviewed-by: Sam Ravnborg <sam@ravnborg.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20230107191822.3787147-13-javierm@redhat.com
18 months agodrm/panel-mantix-mlaf057we51: Drop custom DSI write macro
Javier Martinez Canillas [Sat, 7 Jan 2023 19:18:20 +0000 (20:18 +0100)]
drm/panel-mantix-mlaf057we51: Drop custom DSI write macro

There is a macro for this already in the <drm/drm_mipi_dsi.h> header, use
that instead and delete the custom DSI write macro defined in the driver.

Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
Reviewed-by: Sam Ravnborg <sam@ravnborg.org>
Reviewed-by: Guido Günther <agx@sigxcpu.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20230107191822.3787147-12-javierm@redhat.com
18 months agodrm/panel-sharp-ls060t1sx01: Drop custom DSI write macro
Javier Martinez Canillas [Sat, 7 Jan 2023 19:18:19 +0000 (20:18 +0100)]
drm/panel-sharp-ls060t1sx01: Drop custom DSI write macro

There is a macro for this already in the <drm/drm_mipi_dsi.h> header, use
that instead and delete the custom DSI write macro defined in the driver.

Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
Reviewed-by: Sam Ravnborg <sam@ravnborg.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20230107191822.3787147-11-javierm@redhat.com
18 months agodrm/panel-samsung-sofef00: Drop custom DSI write macro
Javier Martinez Canillas [Sat, 7 Jan 2023 19:18:18 +0000 (20:18 +0100)]
drm/panel-samsung-sofef00: Drop custom DSI write macro

There is a macro for this already in the <drm/drm_mipi_dsi.h> header, use
that instead and delete the custom DSI write macro defined in the driver.

Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
Reviewed-by: Sam Ravnborg <sam@ravnborg.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20230107191822.3787147-10-javierm@redhat.com
18 months agodrm/panel-samsung-s6e88a0-ams452ef01: Drop custom DSI write macro
Javier Martinez Canillas [Sat, 7 Jan 2023 19:18:17 +0000 (20:18 +0100)]
drm/panel-samsung-s6e88a0-ams452ef01: Drop custom DSI write macro

There is a macro for this already in the <drm/drm_mipi_dsi.h> header, use
that instead and delete the custom DSI write macro defined in the driver.

Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
Reviewed-by: Sam Ravnborg <sam@ravnborg.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20230107191822.3787147-9-javierm@redhat.com
18 months agodrm/panel-jdi-fhd-r63452: Drop custom DSI write macros
Javier Martinez Canillas [Sat, 7 Jan 2023 19:18:16 +0000 (20:18 +0100)]
drm/panel-jdi-fhd-r63452: Drop custom DSI write macros

There are macros for these already in the <drm/drm_mipi_dsi.h> header, use
that instead and delete the custom DSI write macros defined in the driver.

Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
Reviewed-by: Sam Ravnborg <sam@ravnborg.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20230107191822.3787147-8-javierm@redhat.com
18 months agodrm/panel-novatek-nt35950: Drop custom DSI write macro
Javier Martinez Canillas [Sat, 7 Jan 2023 19:18:15 +0000 (20:18 +0100)]
drm/panel-novatek-nt35950: Drop custom DSI write macro

There is a macro for this already in the <drm/drm_mipi_dsi.h> header, use
that instead and delete the custom DSI write macro defined in the driver.

Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
Reviewed-by: Sam Ravnborg <sam@ravnborg.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20230107191822.3787147-7-javierm@redhat.com
18 months agodrm/panel-boe-bf060y8m-aj0: Drop custom DSI write macro
Javier Martinez Canillas [Sat, 7 Jan 2023 19:18:14 +0000 (20:18 +0100)]
drm/panel-boe-bf060y8m-aj0: Drop custom DSI write macro

There is a macro for this already in the <drm/drm_mipi_dsi.h> header, use
that instead and delete the custom DSI write macro defined in the driver.

Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
Reviewed-by: Sam Ravnborg <sam@ravnborg.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20230107191822.3787147-6-javierm@redhat.com
18 months agodrm/panel-elida-kd35t133: Drop custom DSI write macro
Javier Martinez Canillas [Sat, 7 Jan 2023 19:18:13 +0000 (20:18 +0100)]
drm/panel-elida-kd35t133: Drop custom DSI write macro

There is a macro for this already in the <drm/drm_mipi_dsi.h> header, use
that instead and delete the custom DSI write macro defined in the driver.

Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
Reviewed-by: Sam Ravnborg <sam@ravnborg.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20230107191822.3787147-5-javierm@redhat.com
18 months agodrm/panel-leadtek-ltk050h3146w: Drop custom DSI write macro
Javier Martinez Canillas [Sat, 7 Jan 2023 19:18:12 +0000 (20:18 +0100)]
drm/panel-leadtek-ltk050h3146w: Drop custom DSI write macro

There is a macro for this already in the <drm/drm_mipi_dsi.h> header, use
that instead and delete the custom DSI write macro defined in the driver.

Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
Reviewed-by: Sam Ravnborg <sam@ravnborg.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20230107191822.3787147-4-javierm@redhat.com
18 months agodrm/panel-sitronix-st7703: Drop custom DSI write macros
Javier Martinez Canillas [Sat, 7 Jan 2023 19:18:11 +0000 (20:18 +0100)]
drm/panel-sitronix-st7703: Drop custom DSI write macros

There are macros for these already in the <drm/drm_mipi_dsi.h> header, use
that instead and delete the custom DSI write macros defined in the driver.

Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
Reviewed-by: Sam Ravnborg <sam@ravnborg.org>
Reviewed-by: Guido Günther <agx@sigxcpu.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20230107191822.3787147-3-javierm@redhat.com
18 months agodrm/panel-asus-z00t-tm5p5-n35596: Drop custom DSI write macros
Javier Martinez Canillas [Sat, 7 Jan 2023 19:18:10 +0000 (20:18 +0100)]
drm/panel-asus-z00t-tm5p5-n35596: Drop custom DSI write macros

There are macros for these already in the <drm/drm_mipi_dsi.h> header, use
that instead and delete the custom DSI write macros defined in the driver.

Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
Reviewed-by: Sam Ravnborg <sam@ravnborg.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20230107191822.3787147-2-javierm@redhat.com
18 months agodrm/panel-edp: add IVO M133NW4J panel entry
Abel Vesa [Sat, 31 Dec 2022 14:27:21 +0000 (16:27 +0200)]
drm/panel-edp: add IVO M133NW4J panel entry

Add an eDP panel entry for IVO M133NW4J.

Due to lack of documentation, use the delay_200_500_p2e100 timings like
some other IVO entries for now.

Signed-off-by: Abel Vesa <abel.vesa@linaro.org>
Reviewed-by: Johan Hovold <johan+linaro@kernel.org>
Reviewed-by: Douglas Anderson <dianders@chromium.org>
Signed-off-by: Douglas Anderson <dianders@chromium.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20221231142721.338643-2-abel.vesa@linaro.org
18 months agodrm/panel-edp: fix name for IVO product id 854b
Abel Vesa [Sat, 31 Dec 2022 14:27:20 +0000 (16:27 +0200)]
drm/panel-edp: fix name for IVO product id 854b

The actual name is R133NW4K-R0.

Fixes: 0f9fa5f58c78 ("drm/panel-edp: add IVO M133NW4J-R3 panel entry")
Signed-off-by: Abel Vesa <abel.vesa@linaro.org>
Reviewed-by: Johan Hovold <johan+linaro@kernel.org>
Tested-by: Steev Klimaszewski <steev@kali.org>
Reviewed-by: Douglas Anderson <dianders@chromium.org>
Signed-off-by: Douglas Anderson <dianders@chromium.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20221231142721.338643-1-abel.vesa@linaro.org
18 months agodrm/amdkfd: Fix NULL pointer error for GC 11.0.1 on mGPU
Eric Huang [Thu, 5 Jan 2023 19:01:18 +0000 (14:01 -0500)]
drm/amdkfd: Fix NULL pointer error for GC 11.0.1 on mGPU

The point bo->kfd_bo is NULL for queue's write pointer BO
when creating queue on mGPU. To avoid using the pointer
fixes the error.

Signed-off-by: Eric Huang <jinhuieric.huang@amd.com>
Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
18 months agodrm/amd/display: No need for Null pointer check before kfree
Deepak R Varma [Tue, 27 Dec 2022 18:39:51 +0000 (00:09 +0530)]
drm/amd/display: No need for Null pointer check before kfree

kfree() & vfree() internally performs NULL check on the pointer handed
to it and take no action if it indeed is NULL. Hence there is no need
for a pre-check of the memory pointer before handing it to
kfree()/vfree().

Issue reported by ifnullfree.cocci Coccinelle semantic patch script.

Reviewed-by: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>
Signed-off-by: Deepak R Varma <drv@mailo.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
18 months agodrm/amd/pm/smu13: BACO is supported when it's in BACO state
Guchun Chen [Tue, 10 Jan 2023 03:33:44 +0000 (11:33 +0800)]
drm/amd/pm/smu13: BACO is supported when it's in BACO state

This leverages the logic in smu11. No need to talk to SMU to
check BACO enablement as it's in BACO state already.

Signed-off-by: Guchun Chen <guchun.chen@amd.com>
Reviewed-by: Kenneth Feng <kenneth.feng@amd.com>
Reviewed-by: Lijo Lazar <lijo.lazar@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
18 months agodrm/amdkfd: Add sync after creating vram bo
Eric Huang [Mon, 9 Jan 2023 19:16:42 +0000 (14:16 -0500)]
drm/amdkfd: Add sync after creating vram bo

There will be data corruption on vram allocated by svm
if the initialization is not complete and application is
writting on the memory. Adding sync to wait for the
initialization completion is to resolve this issue.

Signed-off-by: Eric Huang <jinhuieric.huang@amd.com>
Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
18 months agodrm/amdkfd: Use resource_size() helper function
Deepak R Varma [Thu, 22 Dec 2022 21:15:00 +0000 (02:45 +0530)]
drm/amdkfd: Use resource_size() helper function

Use the resource_size() function instead of a open coded computation
resource size. It makes the code more readable.

Issue identified using resource_size.cocci coccinelle semantic patch.

Signed-off-by: Deepak R Varma <drv@mailo.com>
Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com>
Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
18 months agodrm/i915/mtl: update scaler source and destination limits for MTL
Animesh Manna [Fri, 23 Dec 2022 13:05:09 +0000 (15:05 +0200)]
drm/i915/mtl: update scaler source and destination limits for MTL

The max source and destination limits for scalers in MTL have changed.
Use the new values accordingly.

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Signed-off-by: Animesh Manna <animesh.manna@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Reviewed-by: Stanislav Lisovskiy <stanislav.lisovskiy@intel.com>
Signed-off-by: Radhakrishna Sripada <radhakrishna.sripada@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20221223130509.43245-3-luciano.coelho@intel.com
18 months agodrm/i915/mtl: limit second scaler vertical scaling in ver >= 14
Luca Coelho [Fri, 23 Dec 2022 13:05:08 +0000 (15:05 +0200)]
drm/i915/mtl: limit second scaler vertical scaling in ver >= 14

In newer hardware versions (i.e. display version >= 14), the second
scaler doesn't support vertical scaling.

The current implementation of the scaling limits is simplified and
only occurs when the planes are created, so we don't know which scaler
is being used.

In order to handle separate scaling limits for horizontal and vertical
scaling, and different limits per scaler, split the checks in two
phases.  We first do a simple check during plane creation and use the
best-case scenario (because we don't know the scaler that may be used
at a later point) and then do a more specific check when the scalers
are actually being set up.

Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Reviewed-by: Stanislav Lisovskiy <stanislav.lisovskiy@intel.com>
Signed-off-by: Radhakrishna Sripada <radhakrishna.sripada@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20221223130509.43245-2-luciano.coelho@intel.com
18 months agodrm/amdgpu: Fixed bug on error when unloading amdgpu
YiPeng Chai [Fri, 6 Jan 2023 06:04:15 +0000 (14:04 +0800)]
drm/amdgpu: Fixed bug on error when unloading amdgpu

Fixed bug on error when unloading amdgpu.

The error message is as follows:
[  377.706202] kernel BUG at drivers/gpu/drm/drm_buddy.c:278!
[  377.706215] invalid opcode: 0000 [#1] PREEMPT SMP NOPTI
[  377.706222] CPU: 4 PID: 8610 Comm: modprobe Tainted: G          IOE      6.0.0-thomas #1
[  377.706231] Hardware name: ASUS System Product Name/PRIME Z390-A, BIOS 2004 11/02/2021
[  377.706238] RIP: 0010:drm_buddy_free_block+0x26/0x30 [drm_buddy]
[  377.706264] Code: 00 00 00 90 0f 1f 44 00 00 48 8b 0e 89 c8 25 00 0c 00 00 3d 00 04 00 00 75 10 48 8b 47 18 48 d3 e0 48 01 47 28 e9 fa fe ff ff <0f> 0b 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 41 54 55 48 89 f5 53
[  377.706282] RSP: 0018:ffffad2dc4683cb8 EFLAGS: 00010287
[  377.706289] RAX: 0000000000000000 RBX: ffff8b1743bd5138 RCX: 0000000000000000
[  377.706297] RDX: ffff8b1743bd5160 RSI: ffff8b1743bd5c78 RDI: ffff8b16d1b25f70
[  377.706304] RBP: ffff8b1743bd59e0 R08: 0000000000000001 R09: 0000000000000001
[  377.706311] R10: ffff8b16c8572400 R11: ffffad2dc4683cf0 R12: ffff8b16d1b25f70
[  377.706318] R13: ffff8b16d1b25fd0 R14: ffff8b1743bd59c0 R15: ffff8b16d1b25f70
[  377.706325] FS:  00007fec56c72c40(0000) GS:ffff8b1836500000(0000) knlGS:0000000000000000
[  377.706334] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[  377.706340] CR2: 00007f9b88c1ba50 CR3: 0000000110450004 CR4: 00000000003706e0
[  377.706347] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
[  377.706354] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
[  377.706361] Call Trace:
[  377.706365]  <TASK>
[  377.706369]  drm_buddy_free_list+0x2a/0x60 [drm_buddy]
[  377.706376]  amdgpu_vram_mgr_fini+0xea/0x180 [amdgpu]
[  377.706572]  amdgpu_ttm_fini+0x12e/0x1a0 [amdgpu]
[  377.706650]  amdgpu_bo_fini+0x22/0x90 [amdgpu]
[  377.706727]  gmc_v11_0_sw_fini+0x26/0x30 [amdgpu]
[  377.706821]  amdgpu_device_fini_sw+0xa1/0x3c0 [amdgpu]
[  377.706897]  amdgpu_driver_release_kms+0x12/0x30 [amdgpu]
[  377.706975]  drm_dev_release+0x20/0x40 [drm]
[  377.707006]  release_nodes+0x35/0xb0
[  377.707014]  devres_release_all+0x8b/0xc0
[  377.707020]  device_unbind_cleanup+0xe/0x70
[  377.707027]  device_release_driver_internal+0xee/0x160
[  377.707033]  driver_detach+0x44/0x90
[  377.707039]  bus_remove_driver+0x55/0xe0
[  377.707045]  pci_unregister_driver+0x3b/0x90
[  377.707052]  amdgpu_exit+0x11/0x6c [amdgpu]
[  377.707194]  __x64_sys_delete_module+0x142/0x2b0
[  377.707201]  ? fpregs_assert_state_consistent+0x22/0x50
[  377.707208]  ? exit_to_user_mode_prepare+0x3e/0x190
[  377.707215]  do_syscall_64+0x38/0x90
[  377.707221]  entry_SYSCALL_64_after_hwframe+0x63/0xcd

Signed-off-by: YiPeng Chai <YiPeng.Chai@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
18 months agodrm/amd: make amdgpu_ucode_validate static
Mario Limonciello [Wed, 4 Jan 2023 15:13:34 +0000 (09:13 -0600)]
drm/amd: make amdgpu_ucode_validate static

No consumers outside of amdgpu_ucode.c use amdgpu_ucode_validate
anymore, so make the function static.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Lijo Lazar <lijo.lazar@amd.com>
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
18 months agodrm/amd: Use `amdgpu_ucode_release` helper for si
Mario Limonciello [Wed, 4 Jan 2023 14:40:28 +0000 (08:40 -0600)]
drm/amd: Use `amdgpu_ucode_release` helper for si

The `amdgpu_ucode_release` helper is replacing all calls
to release_firmware.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Lijo Lazar <lijo.lazar@amd.com>
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
18 months agodrm/amd: Use `amdgpu_ucode_release` helper for powerplay
Mario Limonciello [Wed, 4 Jan 2023 14:39:06 +0000 (08:39 -0600)]
drm/amd: Use `amdgpu_ucode_release` helper for powerplay

The `amdgpu_ucode_release` helper is replacing all calls to
release_firmware.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Lijo Lazar <lijo.lazar@amd.com>
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
18 months agodrm/amd: Use `amdgpu_ucode_*` helpers for DMCU
Mario Limonciello [Wed, 4 Jan 2023 14:38:42 +0000 (08:38 -0600)]
drm/amd: Use `amdgpu_ucode_*` helpers for DMCU

The `amdgpu_ucode_request` helper will ensure that the return code for
missing firmware is -ENODEV so that early_init can fail.

The `amdgpu_ucode_release` helper is for symmetry on unloading.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Lijo Lazar <lijo.lazar@amd.com>
Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
18 months agodrm/amd: Use `amdgpu_ucode_*` helpers for GPU info bin
Mario Limonciello [Wed, 4 Jan 2023 14:38:23 +0000 (08:38 -0600)]
drm/amd: Use `amdgpu_ucode_*` helpers for GPU info bin

The `amdgpu_ucode_request` helper will ensure that the return code for
missing firmware is -ENODEV so that early_init can fail.

The `amdgpu_ucode_release` helper is for symmetry on unloading.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Lijo Lazar <lijo.lazar@amd.com>
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
18 months agodrm/amd: Use `amdgpu_ucode_*` helpers for CGS
Mario Limonciello [Wed, 4 Jan 2023 14:37:32 +0000 (08:37 -0600)]
drm/amd: Use `amdgpu_ucode_*` helpers for CGS

The `amdgpu_ucode_request` helper will ensure that the return code for
missing firmware is -ENODEV so that early_init can fail.

The `amdgpu_ucode_release` helper is for symmetry on unloading.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Lijo Lazar <lijo.lazar@amd.com>
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
18 months agodrm/amd: Use `amdgpu_ucode_*` helpers for VCE
Mario Limonciello [Wed, 4 Jan 2023 14:37:20 +0000 (08:37 -0600)]
drm/amd: Use `amdgpu_ucode_*` helpers for VCE

The `amdgpu_ucode_request` helper will ensure that the return code for
missing firmware is -ENODEV so that early_init can fail.

The `amdgpu_ucode_release` helper is for symmetry on unloading.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Lijo Lazar <lijo.lazar@amd.com>
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
18 months agodrm/amd: Use `amdgpu_ucode_*` helpers for UVD
Mario Limonciello [Wed, 4 Jan 2023 14:37:05 +0000 (08:37 -0600)]
drm/amd: Use `amdgpu_ucode_*` helpers for UVD

The `amdgpu_ucode_request` helper will ensure that the return code for
missing firmware is -ENODEV so that early_init can fail.

The `amdgpu_ucode_release` helper is for symmetry on unloading.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Lijo Lazar <lijo.lazar@amd.com>
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
18 months agodrm/amd: Use `amdgpu_ucode_*` helpers for SDMA on CIK
Mario Limonciello [Wed, 4 Jan 2023 14:36:47 +0000 (08:36 -0600)]
drm/amd: Use `amdgpu_ucode_*` helpers for SDMA on CIK

The `amdgpu_ucode_request` helper will ensure that the return code for
missing firmware is -ENODEV so that early_init can fail.

The `amdgpu_ucode_release` helper is for symmetry on unloading.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Lijo Lazar <lijo.lazar@amd.com>
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
18 months agodrm/amd: Use `amdgpu_ucode_*` helpers for SDMA3.0
Mario Limonciello [Wed, 4 Jan 2023 14:36:19 +0000 (08:36 -0600)]
drm/amd: Use `amdgpu_ucode_*` helpers for SDMA3.0

The `amdgpu_ucode_request` helper will ensure that the return code for
missing firmware is -ENODEV so that early_init can fail.

The `amdgpu_ucode_release` helper is for symmetry on unloading.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Lijo Lazar <lijo.lazar@amd.com>
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
18 months agodrm/amd: Use `amdgpu_ucode_*` helpers for SDMA2.4
Mario Limonciello [Wed, 4 Jan 2023 14:36:06 +0000 (08:36 -0600)]
drm/amd: Use `amdgpu_ucode_*` helpers for SDMA2.4

The `amdgpu_ucode_request` helper will ensure that the return code for
missing firmware is -ENODEV so that early_init can fail.

The `amdgpu_ucode_release` helper is for symmetry on unloading.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Lijo Lazar <lijo.lazar@amd.com>
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
18 months agodrm/amd: Use `amdgpu_ucode_*` helpers for GMC8
Mario Limonciello [Wed, 4 Jan 2023 14:35:58 +0000 (08:35 -0600)]
drm/amd: Use `amdgpu_ucode_*` helpers for GMC8

The `amdgpu_ucode_request` helper will ensure that the return code for
missing firmware is -ENODEV so that early_init can fail.

The `amdgpu_ucode_release` helper is for symmetry on unloading.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Lijo Lazar <lijo.lazar@amd.com>
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
18 months agodrm/amd: Use `amdgpu_ucode_*` helpers for GMC7
Mario Limonciello [Wed, 4 Jan 2023 14:35:46 +0000 (08:35 -0600)]
drm/amd: Use `amdgpu_ucode_*` helpers for GMC7

The `amdgpu_ucode_request` helper will ensure that the return code for
missing firmware is -ENODEV so that early_init can fail.

The `amdgpu_ucode_release` helper is for symmetry on unloading.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Lijo Lazar <lijo.lazar@amd.com>
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
18 months agodrm/amd: Use `amdgpu_ucode_*` helpers for GMC6
Mario Limonciello [Wed, 4 Jan 2023 14:35:30 +0000 (08:35 -0600)]
drm/amd: Use `amdgpu_ucode_*` helpers for GMC6

The `amdgpu_ucode_request` helper will ensure that the return code for
missing firmware is -ENODEV so that early_init can fail.

The `amdgpu_ucode_release` helper is for symmetry on unloading.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Lijo Lazar <lijo.lazar@amd.com>
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
18 months agodrm/amd: Use `amdgpu_ucode_*` helpers for GFX8
Mario Limonciello [Wed, 4 Jan 2023 14:35:19 +0000 (08:35 -0600)]
drm/amd: Use `amdgpu_ucode_*` helpers for GFX8

The `amdgpu_ucode_request` helper will ensure that the return code for
missing firmware is -ENODEV so that early_init can fail.

The `amdgpu_ucode_release` helper is for symmetry on unloading.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Lijo Lazar <lijo.lazar@amd.com>
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
18 months agodrm/amd: Use `amdgpu_ucode_*` helpers for GFX7
Mario Limonciello [Wed, 4 Jan 2023 14:35:09 +0000 (08:35 -0600)]
drm/amd: Use `amdgpu_ucode_*` helpers for GFX7

The `amdgpu_ucode_request` helper will ensure that the return code for
missing firmware is -ENODEV so that early_init can fail.

The `amdgpu_ucode_release` helper is for symmetry on unloading.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Lijo Lazar <lijo.lazar@amd.com>
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
18 months agodrm/amd: Use `amdgpu_ucode_*` helpers for GFX6
Mario Limonciello [Wed, 4 Jan 2023 14:34:28 +0000 (08:34 -0600)]
drm/amd: Use `amdgpu_ucode_*` helpers for GFX6

The `amdgpu_ucode_request` helper will ensure that the return code for
missing firmware is -ENODEV so that early_init can fail.

The `amdgpu_ucode_release` helper is for symmetry on unloading.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Lijo Lazar <lijo.lazar@amd.com>
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
18 months agodrm/amd: Optimize SRIOV switch/case for PSP microcode load
Mario Limonciello [Tue, 3 Jan 2023 21:58:52 +0000 (15:58 -0600)]
drm/amd: Optimize SRIOV switch/case for PSP microcode load

Now that IP version decoding is used, a number of case statements
can be combined.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Lijo Lazar <lijo.lazar@amd.com>
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
18 months agodrm/amd: Load SMU microcode during early_init
Mario Limonciello [Tue, 3 Jan 2023 21:43:27 +0000 (15:43 -0600)]
drm/amd: Load SMU microcode during early_init

This will ensure that the microcode is available before the firmware
framebuffer has been destroyed.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Lijo Lazar <lijo.lazar@amd.com>
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
18 months agodrm/amd: Use `amdgpu_ucode_*` helpers for SMU
Mario Limonciello [Tue, 3 Jan 2023 21:40:19 +0000 (15:40 -0600)]
drm/amd: Use `amdgpu_ucode_*` helpers for SMU

The `amdgpu_ucode_request` helper will ensure that the return code for
missing firmware is -ENODEV so that early_init can fail.

The `amdgpu_ucode_release` helper is for symmetry on unloading.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Lijo Lazar <lijo.lazar@amd.com>
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
18 months agodrm/amd: Use `amdgpu_ucode_release` helper for DMUB
Mario Limonciello [Wed, 4 Jan 2023 05:49:43 +0000 (23:49 -0600)]
drm/amd: Use `amdgpu_ucode_release` helper for DMUB

The `amdgpu_ucode_release` helper is for symmetry on unloading.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Lijo Lazar <lijo.lazar@amd.com>
Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
18 months agodrm/amd/display: Load DMUB microcode during early_init
Mario Limonciello [Tue, 3 Jan 2023 21:04:23 +0000 (15:04 -0600)]
drm/amd/display: Load DMUB microcode during early_init

If DMUB is required for an ASIC, ensure that the microcode is available
and validates during early_init.

Any failures will cause the driver to fail to probe before the firmware
framebuffer has been removed.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Reviewed-by: Lijo Lazar <lijo.lazar@amd.com>
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
18 months agodrm/amd: Use `amdgpu_ucode_*` helpers for PSP
Mario Limonciello [Tue, 3 Jan 2023 20:45:18 +0000 (14:45 -0600)]
drm/amd: Use `amdgpu_ucode_*` helpers for PSP

The `amdgpu_ucode_request` helper will ensure that the return code for
missing firmware is -ENODEV so that early_init can fail.

The `amdgpu_ucode_release` helper is for symmetry on unloading.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Lijo Lazar <lijo.lazar@amd.com>
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
18 months agodrm/amd: Load PSP microcode during early_init
Mario Limonciello [Tue, 3 Jan 2023 20:41:33 +0000 (14:41 -0600)]
drm/amd: Load PSP microcode during early_init

Simplifies the code so that all PSP versions will get the firmware
name from `amdgpu_ucode_ip_version_decode` and then use this filename
to load microcode as part of the early_init process.

Any failures will cause the driver to fail to probe before the firmware
framebuffer has been removed.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Lijo Lazar <lijo.lazar@amd.com>
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
18 months agodrm/amd: Avoid BUG() for case of SRIOV missing IP version
Mario Limonciello [Tue, 3 Jan 2023 22:03:41 +0000 (16:03 -0600)]
drm/amd: Avoid BUG() for case of SRIOV missing IP version

No need to crash the kernel.  AMDGPU will now fail to probe.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Lijo Lazar <lijo.lazar@amd.com>
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
18 months agodrm/amd: Parse both v1 and v2 TA microcode headers using same function
Mario Limonciello [Tue, 3 Jan 2023 20:33:37 +0000 (14:33 -0600)]
drm/amd: Parse both v1 and v2 TA microcode headers using same function

Several IP versions duplicate code and can't use the common helpers.
Move this code into a single function so that the helpers can be used.

v2: squash in fix from Mario to remove duplicate ta parsing

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
18 months agodrm/drm_lease: Remove usage of deprecated DRM_DEBUG_LEASE
Siddh Raman Pant [Mon, 9 Jan 2023 13:00:35 +0000 (18:30 +0530)]
drm/drm_lease: Remove usage of deprecated DRM_DEBUG_LEASE

drm_print.h says DRM_DEBUG_LEASE is deprecated in favor of
drm_dbg_lease().

Signed-off-by: Siddh Raman Pant <code@siddh.me>
Reviewed-by: Simon Ser <contact@emersion.fr>
Signed-off-by: Simon Ser <contact@emersion.fr>
Link: https://patchwork.freedesktop.org/patch/msgid/71a443d705c62a217a3352b221b7a96c53bb1031.1673269059.git.code@siddh.me
18 months agodrm/drm_blend: Remove usage of deprecated DRM_DEBUG_ATOMIC
Siddh Raman Pant [Mon, 9 Jan 2023 13:00:34 +0000 (18:30 +0530)]
drm/drm_blend: Remove usage of deprecated DRM_DEBUG_ATOMIC

drm_print.h says DRM_DEBUG_ATOMIC is deprecated in favor of
drm_dbg_atomic().

Signed-off-by: Siddh Raman Pant <code@siddh.me>
Reviewed-by: Simon Ser <contact@emersion.fr>
Signed-off-by: Simon Ser <contact@emersion.fr>
Link: https://patchwork.freedesktop.org/patch/msgid/1a5b5aa012689572baf561eea0dd0b5934645af5.1673269059.git.code@siddh.me
18 months agodrm: Remove usage of deprecated DRM_DEBUG_PRIME
Siddh Raman Pant [Mon, 9 Jan 2023 13:00:33 +0000 (18:30 +0530)]
drm: Remove usage of deprecated DRM_DEBUG_PRIME

drm_print.h says DRM_DEBUG_PRIME is deprecated in favor of
drm_dbg_prime().

Signed-off-by: Siddh Raman Pant <code@siddh.me>
Reviewed-by: Simon Ser <contact@emersion.fr>
Signed-off-by: Simon Ser <contact@emersion.fr>
Link: https://patchwork.freedesktop.org/patch/msgid/cd663b1bc42189e55898cddecdb3b73c591b341a.1673269059.git.code@siddh.me
18 months agodrm/imx/dcss: Don't call dev_set_drvdata(..., NULL);
Uwe Kleine-König [Fri, 30 Dec 2022 13:00:25 +0000 (14:00 +0100)]
drm/imx/dcss: Don't call dev_set_drvdata(..., NULL);

The driver core takes care about removing driver data, so this can be
dropped from the driver.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Reviewed-by: Laurentiu Palcu <laurentiu.palcu@oss.nxp.com>
Signed-off-by: Laurentiu Palcu <laurentiu.palcu@oss.nxp.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20221230130025.240776-2-u.kleine-koenig@pengutronix.de
18 months agodrm/imx/dcss: Drop if blocks with always false condition
Uwe Kleine-König [Fri, 30 Dec 2022 13:00:24 +0000 (14:00 +0100)]
drm/imx/dcss: Drop if blocks with always false condition

dcss_drv_platform_remove() is only called for a device after
dcss_drv_platform_probe() returned 0. In that case dev_set_drvdata() was
called with a non-NULL value and so dev_get_drvdata() won't return NULL.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Reviewed-by: Laurentiu Palcu <laurentiu.palcu@oss.nxp.com>
Signed-off-by: Laurentiu Palcu <laurentiu.palcu@oss.nxp.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20221230130025.240776-1-u.kleine-koenig@pengutronix.de
18 months agodrm/debugfs: add descriptions to struct parameters
Maíra Canal [Thu, 5 Jan 2023 19:30:39 +0000 (16:30 -0300)]
drm/debugfs: add descriptions to struct parameters

The structs drm_debugfs_info and drm_debugfs_entry don't have
descriptions for their parameters, which is causing the following warnings:

include/drm/drm_debugfs.h:93: warning: Function parameter or member
'name' not described in 'drm_debugfs_info'
include/drm/drm_debugfs.h:93: warning: Function parameter or member
'show' not described in 'drm_debugfs_info'
include/drm/drm_debugfs.h:93: warning: Function parameter or member
'driver_features' not described in 'drm_debugfs_info'
include/drm/drm_debugfs.h:93: warning: Function parameter or member
'data' not described in 'drm_debugfs_info'
include/drm/drm_debugfs.h:105: warning: Function parameter or member
'dev' not described in 'drm_debugfs_entry'
include/drm/drm_debugfs.h:105: warning: Function parameter or member
'file' not described in 'drm_debugfs_entry'
include/drm/drm_debugfs.h:105: warning: Function parameter or member
'list' not described in 'drm_debugfs_entry'

Therefore, fix the warnings by adding descriptions to all struct
parameters.

Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Maíra Canal <mcanal@igalia.com>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Maíra Canal <mairacanal@riseup.net>
Link: https://patchwork.freedesktop.org/patch/msgid/20230105193039.287677-2-mcanal@igalia.com
18 months agodrm/debugfs: use octal permissions instead of symbolic permissions
Maíra Canal [Thu, 5 Jan 2023 19:30:38 +0000 (16:30 -0300)]
drm/debugfs: use octal permissions instead of symbolic permissions

Currently, debugfs functions are using symbolic macros as permission
bits, but checkpatch reinforces permission bits in the octal form, as
they are more readable and easier to understand [1]. Moreover, using
the symbolic macro S_IFREG is redundant.

Therefore, use octal permission bits in all debugfs functions.

[1] https://docs.kernel.org/dev-tools/checkpatch.html#permissions

Suggested-by: Jani Nikula <jani.nikula@linux.intel.com>
Signed-off-by: Maíra Canal <mcanal@igalia.com>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
Signed-off-by: Maíra Canal <mairacanal@riseup.net>
Link: https://patchwork.freedesktop.org/patch/msgid/20230105193039.287677-1-mcanal@igalia.com
18 months agoMAINTAINERS: Add entry for Himax HX8394 panel controller driver
Javier Martinez Canillas [Mon, 2 Jan 2023 23:07:33 +0000 (00:07 +0100)]
MAINTAINERS: Add entry for Himax HX8394 panel controller driver

Add myself as maintainer for the driver and devicetree bindings schema.

Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
Acked-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20230102230733.3506624-4-javierm@redhat.com
18 months agodrm: panel: Add Himax HX8394 panel controller driver
Kamil Trzciński [Mon, 2 Jan 2023 23:07:32 +0000 (00:07 +0100)]
drm: panel: Add Himax HX8394 panel controller driver

The driver is for panels based on the Himax HX8394 controller, such as the
HannStar HSD060BHW4 720x1440 TFT LCD panel that uses a MIPI-DSI interface.

Signed-off-by: Kamil Trzciński <ayufan@ayufan.eu>
Co-developed-by: Ondrej Jirman <megi@xff.cz>
Signed-off-by: Ondrej Jirman <megi@xff.cz>
Co-developed-by: Javier Martinez Canillas <javierm@redhat.com>
Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
Reviewed-by: Sam Ravnborg <sam@ravnborg.org>
Tested-by: Tom Fitzhenry <tom@tom-fitzhenry.me.uk>
Tested-by: Peter Robinson <pbrobinson@gmail.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20230102230733.3506624-3-javierm@redhat.com
18 months agodt-bindings: display: Add Himax HX8394 panel controller
Javier Martinez Canillas [Mon, 2 Jan 2023 23:07:31 +0000 (00:07 +0100)]
dt-bindings: display: Add Himax HX8394 panel controller

Add device tree bindings for panels based on the Himax HX8394 controller,
such as the HannStar HSD060BHW4 720x1440 TFT LCD panel that is connected
through a MIPI-DSI video interface.

Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20230102230733.3506624-2-javierm@redhat.com
18 months agodoc: add dma-buf IOCTL code to table
Simon Ser [Mon, 28 Nov 2022 13:39:05 +0000 (13:39 +0000)]
doc: add dma-buf IOCTL code to table

The code 'b' is used for dma-buf IOCTLs.

Signed-off-by: Simon Ser <contact@emersion.fr>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Daniel Vetter <daniel@ffwll.ch>
Cc: Christian König <christian.koenig@amd.com>
Cc: Sumit Semwal <sumit.semwal@linaro.org>
Reviewed-by: Christian König <christian.koenig@amd.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20221128133853.355645-1-contact@emersion.fr
18 months agodrm/vc4: dsi: Drop unused i2c include
Uwe Kleine-König [Mon, 19 Dec 2022 08:40:23 +0000 (09:40 +0100)]
drm/vc4: dsi: Drop unused i2c include

The driver doesn't make use of any symbol provided by <linux/i2c.h>. So
drop the include.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20221219084023.1402282-1-u.kleine-koenig@pengutronix.de
18 months agoMAINTAINERS: drm/hisilicon: Drop Chen Feng
Uwe Kleine-König [Mon, 19 Dec 2022 08:53:07 +0000 (09:53 +0100)]
MAINTAINERS: drm/hisilicon: Drop Chen Feng

The listed address doesn't work any more:

  puck.chen@hisilicon.com
    host mx5.hisilicon.com [124.71.93.234]
    SMTP error from remote mail server after RCPT TO:<puck.chen@hisilicon.com>:
    551 5.1.1 <puck.chen@hisilicon.com>: Recipient address rejected:
    Failed recipient validation check.: host 127.0.0.1[127.0.0.1] said:
    554 5.7.1 recipient verify from ldap failed (in reply to RCPT TO command)

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20221219085307.1403247-1-u.kleine-koenig@pengutronix.de
18 months agodrm: Only select I2C_ALGOBIT for drivers that actually need it
Uwe Kleine-König [Mon, 19 Dec 2022 08:36:27 +0000 (09:36 +0100)]
drm: Only select I2C_ALGOBIT for drivers that actually need it

While working on a drm driver that doesn't need the i2c algobit stuff I
noticed that DRM selects this code even though only 8 drivers actually use
it. While also only some drivers use i2c, keep the select for I2C for the
next cleanup patch. Still prepare this already by also selecting I2C for
the individual drivers.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20221219083627.1401627-1-u.kleine-koenig@pengutronix.de
18 months agodrm/panel: raspberrypi-touchscreen: Convert to i2c's .probe_new()
Uwe Kleine-König [Fri, 18 Nov 2022 22:36:17 +0000 (23:36 +0100)]
drm/panel: raspberrypi-touchscreen: Convert to i2c's .probe_new()

The probe function doesn't make use of the i2c_device_id * parameter so it
can be trivially converted.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20221118224540.619276-44-uwe@kleine-koenig.org
18 months agodrm/panel: olimex-lcd-olinuxino: Convert to i2c's .probe_new()
Uwe Kleine-König [Fri, 18 Nov 2022 22:36:16 +0000 (23:36 +0100)]
drm/panel: olimex-lcd-olinuxino: Convert to i2c's .probe_new()

The probe function doesn't make use of the i2c_device_id * parameter so it
can be trivially converted.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20221118224540.619276-43-uwe@kleine-koenig.org
18 months agodrm/i2c/tda998x: Convert to i2c's .probe_new()
Uwe Kleine-König [Fri, 18 Nov 2022 22:36:15 +0000 (23:36 +0100)]
drm/i2c/tda998x: Convert to i2c's .probe_new()

The probe function doesn't make use of the i2c_device_id * parameter so it
can be trivially converted.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20221118224540.619276-42-uwe@kleine-koenig.org
18 months agodrm/i2c/tda9950: Convert to i2c's .probe_new()
Uwe Kleine-König [Fri, 18 Nov 2022 22:36:14 +0000 (23:36 +0100)]
drm/i2c/tda9950: Convert to i2c's .probe_new()

The probe function doesn't make use of the i2c_device_id * parameter so it
can be trivially converted.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20221118224540.619276-41-uwe@kleine-koenig.org
18 months agodrm/i2c/sil164: Convert to i2c's .probe_new()
Uwe Kleine-König [Fri, 18 Nov 2022 22:36:13 +0000 (23:36 +0100)]
drm/i2c/sil164: Convert to i2c's .probe_new()

The probe function doesn't make use of the i2c_device_id * parameter so it
can be trivially converted.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20221118224540.619276-40-uwe@kleine-koenig.org
18 months agodrm/i2c/ch7006: Convert to i2c's .probe_new()
Uwe Kleine-König [Fri, 18 Nov 2022 22:36:12 +0000 (23:36 +0100)]
drm/i2c/ch7006: Convert to i2c's .probe_new()

The probe function doesn't make use of the i2c_device_id * parameter so it
can be trivially converted.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20221118224540.619276-39-uwe@kleine-koenig.org
18 months agodrm/mxsfb: improve clk handling for axi clk
Uwe Kleine-König [Tue, 10 Jan 2023 09:38:20 +0000 (10:38 +0100)]
drm/mxsfb: improve clk handling for axi clk

Ignoring errors from devm_clk_get() is wrong. To handle not all platforms
having an axi clk use devm_clk_get_optional() instead and do proper error
handling.

Also the clk API handles NULL as a dummy clk (which is also returned by
devm_clk_get_optional() if there is no clk) so there is no need to check
for NULL before calling clk_prepare_enable() or its counter part.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200720153254.18071-1-u.kleine-koenig@pengutronix.de
18 months agodrm/meson: dw-hdmi: Fix devm_regulator_*get_enable*() conversion
Marek Szyprowski [Mon, 9 Jan 2023 22:00:33 +0000 (23:00 +0100)]
drm/meson: dw-hdmi: Fix devm_regulator_*get_enable*() conversion

devm_regulator_get_enable_optional() function returns 0 on success, so
use it for the check if function succeeded instead of the -ENODEV value.

Fixes: 429e87063661 ("drm/meson: dw-hdmi: Use devm_regulator_*get_enable*()")
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Acked-by: Neil Armstrong <neil.armstrong@linaro.org>
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
[narmstrong: s/succeeded/succeeded/ in commit message]
Link: https://patchwork.freedesktop.org/patch/msgid/20230109220033.31202-1-m.szyprowski@samsung.com
18 months agodrm/radeon: free iio for atombios when driver shutdown
Liwei Song [Fri, 6 Jan 2023 09:47:29 +0000 (17:47 +0800)]
drm/radeon: free iio for atombios when driver shutdown

Fix below kmemleak when unload radeon driver:

unreferenced object 0xffff9f8608ede200 (size 512):
  comm "systemd-udevd", pid 326, jiffies 4294682822 (age 716.338s)
  hex dump (first 32 bytes):
    00 00 00 00 c4 aa ec aa 14 ab 00 00 00 00 00 00  ................
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
  backtrace:
    [<0000000062fadebe>] kmem_cache_alloc_trace+0x2f1/0x500
    [<00000000b6883cea>] atom_parse+0x117/0x230 [radeon]
    [<00000000158c23fd>] radeon_atombios_init+0xab/0x170 [radeon]
    [<00000000683f672e>] si_init+0x57/0x750 [radeon]
    [<00000000566cc31f>] radeon_device_init+0x559/0x9c0 [radeon]
    [<0000000046efabb3>] radeon_driver_load_kms+0xc1/0x1a0 [radeon]
    [<00000000b5155064>] drm_dev_register+0xdd/0x1d0
    [<0000000045fec835>] radeon_pci_probe+0xbd/0x100 [radeon]
    [<00000000e69ecca3>] pci_device_probe+0xe1/0x160
    [<0000000019484b76>] really_probe.part.0+0xc1/0x2c0
    [<000000003f2649da>] __driver_probe_device+0x96/0x130
    [<00000000231c5bb1>] driver_probe_device+0x24/0xf0
    [<0000000000a42377>] __driver_attach+0x77/0x190
    [<00000000d7574da6>] bus_for_each_dev+0x7f/0xd0
    [<00000000633166d2>] driver_attach+0x1e/0x30
    [<00000000313b05b8>] bus_add_driver+0x12c/0x1e0

iio was allocated in atom_index_iio() called by atom_parse(),
but it doesn't got released when the dirver is shutdown.
Fix this kmemleak by free it in radeon_atombios_fini().

Signed-off-by: Liwei Song <liwei.song@windriver.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
18 months agodrm/amdgpu: clean up some inconsistent indentings
Yang Li [Fri, 6 Jan 2023 01:32:32 +0000 (09:32 +0800)]
drm/amdgpu: clean up some inconsistent indentings

drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c:65 amdgpu_gem_fault() warn: inconsistent indenting

Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=3639
Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Signed-off-by: Yang Li <yang.lee@linux.alibaba.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
18 months agodrm/amd: Load GFX11 microcode during early_init
Mario Limonciello [Wed, 28 Dec 2022 07:35:20 +0000 (01:35 -0600)]
drm/amd: Load GFX11 microcode during early_init

If GFX11 microcode is required but not available during early init, the
firmware framebuffer will have already been released and the screen will
freeze.

Move the request for GFX11 microcode into the early_init phase
so that if it's not available, driver init will fail.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Lijo Lazar <lijo.lazar@amd.com>
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
18 months agodrm/amd: Use `amdgpu_ucode_*` helpers for GFX11
Mario Limonciello [Tue, 3 Jan 2023 20:30:53 +0000 (14:30 -0600)]
drm/amd: Use `amdgpu_ucode_*` helpers for GFX11

The `amdgpu_ucode_request` helper will ensure that the return code for
missing firmware is -ENODEV so that early_init can fail.

The `amdgpu_ucode_release` helper will provide symmetery on unload.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Lijo Lazar <lijo.lazar@amd.com>
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
18 months agodrm/amd: Load GFX10 microcode during early_init
Mario Limonciello [Wed, 28 Dec 2022 07:34:35 +0000 (01:34 -0600)]
drm/amd: Load GFX10 microcode during early_init

Simplifies the code so that GFX10 will get the firmware
name from `amdgpu_ucode_ip_version_decode` and then use this filename
to load microcode as part of the early_init process.

Any failures will cause the driver to fail to probe before the firmware
framebuffer has been removed.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Lijo Lazar <lijo.lazar@amd.com>
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
18 months agodrm/amd: Use `amdgpu_ucode_*` helpers for GFX10
Mario Limonciello [Tue, 3 Jan 2023 20:22:55 +0000 (14:22 -0600)]
drm/amd: Use `amdgpu_ucode_*` helpers for GFX10

The `amdgpu_ucode_request` helper will ensure that the return code for
missing firmware is -ENODEV so that early_init can fail.

The `amdgpu_ucode_release` helper is for symmetry on unload.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Lijo Lazar <lijo.lazar@amd.com>
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
18 months agodrm/amd: Load GFX9 microcode during early_init
Mario Limonciello [Wed, 28 Dec 2022 07:33:35 +0000 (01:33 -0600)]
drm/amd: Load GFX9 microcode during early_init

If GFX9 microcode is required but not available during early init, the
firmware framebuffer will have already been released and the screen will
freeze.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Lijo Lazar <lijo.lazar@amd.com>
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
18 months agodrm/amd: Use `amdgpu_ucode_*` helpers for GFX9
Mario Limonciello [Tue, 3 Jan 2023 20:18:39 +0000 (14:18 -0600)]
drm/amd: Use `amdgpu_ucode_*` helpers for GFX9

The `amdgpu_ucode_request` helper will ensure that the return code for
missing firmware is -ENODEV so that early_init can fail.

The `amdgpu_ucode_release` helper will provide symmetry on unload.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Lijo Lazar <lijo.lazar@amd.com>
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
18 months agodrm/amd: Remove superfluous assignment for `adev->mes.adev`
Mario Limonciello [Tue, 3 Jan 2023 18:20:56 +0000 (12:20 -0600)]
drm/amd: Remove superfluous assignment for `adev->mes.adev`

`amdgpu_mes_init` already sets `adev->mes.adev`, so there is no need
to also set it in the IP specific versions.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Lijo Lazar <lijo.lazar@amd.com>
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
18 months agodrm/amd: Use `amdgpu_ucode_*` helpers for MES
Mario Limonciello [Tue, 3 Jan 2023 20:12:37 +0000 (14:12 -0600)]
drm/amd: Use `amdgpu_ucode_*` helpers for MES

The `amdgpu_ucode_request` helper will ensure that the return code for
missing firmware is -ENODEV so that early_init can fail.

The `amdgpu_ucode_release` helper provides symmetry for releasing firmware.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Lijo Lazar <lijo.lazar@amd.com>
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
18 months agodrm/amd: Load MES microcode during early_init
Mario Limonciello [Wed, 28 Dec 2022 07:28:40 +0000 (01:28 -0600)]
drm/amd: Load MES microcode during early_init

Add an early_init phase to MES for fetching and validating microcode
from the filesystem.

If MES microcode is required but not available during early init, the
firmware framebuffer will have already been released and the screen will
freeze.

Move the request for MES microcode into the early_init phase
so that if it's not available, early_init will fail.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Lijo Lazar <lijo.lazar@amd.com>
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
18 months agodrm/amd/display: Remove unneeded semicolon
Yang Li [Fri, 6 Jan 2023 00:24:53 +0000 (08:24 +0800)]
drm/amd/display: Remove unneeded semicolon

./drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c:7431:3-4: Unneeded semicolon
./drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c:7485:4-5: Unneeded semicolon
./drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c:7489:3-4: Unneeded semicolon

Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=3635
Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Signed-off-by: Yang Li <yang.lee@linux.alibaba.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
18 months agodrm/amd/display: Remove redundant assignment to variable dc
Yi Yang [Fri, 16 Dec 2022 10:23:18 +0000 (18:23 +0800)]
drm/amd/display: Remove redundant assignment to variable dc

Smatch report warning as follows:

Line 53679: drivers/gpu/drm/amd/display/dc/core/dc_stream.c:402
dc_stream_set_cursor_position() warn: variable dereferenced before
check 'stream'

The value of 'dc' has been assigned after check whether 'stream' is
NULL. Fix it by remove redundant assignment.

Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Yi Yang <yiyang13@huawei.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
18 months agodrm/amd/display: fix PSR-SU/DSC interoperability support
Hamza Mahfooz [Thu, 5 Jan 2023 15:54:12 +0000 (10:54 -0500)]
drm/amd/display: fix PSR-SU/DSC interoperability support

Currently, there are issues with enabling PSR-SU + DSC. This stems from
the fact that DSC imposes a slice height on transmitted video data and
we are not conforming to that slice height in PSR-SU regions. So, pass
slice_height into su_y_granularity to feed the DSC slice height into
PSR-SU code.

Acked-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Hamza Mahfooz <hamza.mahfooz@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
18 months agodrm/amd: Load VCN microcode during early_init
Mario Limonciello [Wed, 28 Dec 2022 07:26:12 +0000 (01:26 -0600)]
drm/amd: Load VCN microcode during early_init

Simplifies the code so that all VCN versions will get the firmware
name from `amdgpu_ucode_ip_version_decode` and then use this filename
to load microcode as part of the early_init process.

Reviewed-by: Lijo Lazar <lijo.lazar@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
18 months agodrm/amd: Use `amdgpu_ucode_*` helpers for VCN
Mario Limonciello [Tue, 3 Jan 2023 20:09:03 +0000 (14:09 -0600)]
drm/amd: Use `amdgpu_ucode_*` helpers for VCN

The `amdgpu_ucode_request` helper will ensure that the return code for
missing firmware is -ENODEV so that early_init can fail.

The `amdgpu_ucode_release` helper is for symmetry.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Lijo Lazar <lijo.lazar@amd.com>
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
18 months agodrm/amd: Make SDMA firmware load failures less noisy.
Mario Limonciello [Tue, 3 Jan 2023 19:07:19 +0000 (13:07 -0600)]
drm/amd: Make SDMA firmware load failures less noisy.

When firmware is missing we get failures at every step.
```
[    3.855086] amdgpu 0000:04:00.0: Direct firmware load for amdgpu/green_sardine_sdma.bin failed with error -2
[    3.855087] [drm:amdgpu_sdma_init_microcode [amdgpu]] *ERROR* SDMA: Failed to init firmware "amdgpu/green_sardine_sdma.bin"
[    3.855398] [drm:sdma_v4_0_early_init [amdgpu]] *ERROR* Failed to load sdma firmware!
```
Realistically we don't need all of these, a user can tell from the first one
that request_firmware emitted what happened. Drop the others.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Lijo Lazar <lijo.lazar@amd.com>
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
18 months agodrm/amd: Convert SDMA to use `amdgpu_ucode_ip_version_decode`
Mario Limonciello [Wed, 28 Dec 2022 07:24:19 +0000 (01:24 -0600)]
drm/amd: Convert SDMA to use `amdgpu_ucode_ip_version_decode`

Simplifies the code so that all SDMA versions will get the firmware
name from `amdgpu_ucode_ip_version_decode`.

v2: squash in fix from Srinivasan

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Lijo Lazar <lijo.lazar@amd.com>
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
18 months agodrm/amd: Use `amdgpu_ucode_request` helper for SDMA
Mario Limonciello [Tue, 3 Jan 2023 19:20:52 +0000 (13:20 -0600)]
drm/amd: Use `amdgpu_ucode_request` helper for SDMA

The `amdgpu_ucode_request` helper will ensure that the return code for
missing firmware is -ENODEV so that early_init can fail.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Lijo Lazar <lijo.lazar@amd.com>
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>