aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2019-08-21drm: kirin: Pass driver data to crtc init and plane initXu YiPing1-10/+13
As part of refactoring the kirin driver to better support different hardware revisions, this patch changes the code via a passed in driver_data pointer, rather than hardcoding them via ade_driver_data variable. This will allow those funcitons to be later moved to the generic kirin_drm_drv.c using alternative driver_data structures that support other hardware. Cc: Rongrong Zou <[email protected]> Cc: Xinliang Liu <[email protected]> Cc: David Airlie <[email protected]> Cc: Daniel Vetter <[email protected]> Cc: dri-devel <[email protected]> Cc: Sam Ravnborg <[email protected]> Acked-by: Xinliang Liu <[email protected]> Reviewed-by: Sam Ravnborg <[email protected]> Signed-off-by: Xu YiPing <[email protected]> [jstultz: Reworded commit message] Signed-off-by: John Stultz <[email protected]> Signed-off-by: Sam Ravnborg <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2019-08-21drm: kirin: Add alloc_hw_ctx/clean_hw_ctx ops in driver dataXu YiPing2-1/+13
As part of refactoring the kirin driver to better support different hardware revisions, this patch changes the alloc/clean_hw_ctx functions to be called via driver_data specific funciton pointers. This will allow the ade_drm_init to later be made generic and moved to kirin_drm_drv.c Cc: Rongrong Zou <[email protected]> Cc: Xinliang Liu <[email protected]> Cc: David Airlie <[email protected]> Cc: Daniel Vetter <[email protected]> Cc: dri-devel <[email protected]> Cc: Sam Ravnborg <[email protected]> Acked-by: Xinliang Liu <[email protected]> Reviewed-by: Sam Ravnborg <[email protected]> Signed-off-by: Xu YiPing <[email protected]> [jstultz: Reworded commit message] Signed-off-by: John Stultz <[email protected]> Signed-off-by: Sam Ravnborg <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2019-08-21drm: kirin: Make driver_data variable non-globalXu YiPing1-19/+24
As part of refactoring the kirin driver to better support different hardware revisions, this patch changes the driver_data value to not be a global variable. Instead the driver_data value is accessed via the of_device_get_match_data() when needed. Cc: Rongrong Zou <[email protected]> Cc: Xinliang Liu <[email protected]> Cc: David Airlie <[email protected]> Cc: Daniel Vetter <[email protected]> Cc: dri-devel <[email protected]> Cc: Sam Ravnborg <[email protected]> Acked-by: Xinliang Liu <[email protected]> Reviewed-by: Sam Ravnborg <[email protected]> Signed-off-by: Xu YiPing <[email protected]> [jstultz: Reworded commit message] Signed-off-by: John Stultz <[email protected]> Signed-off-by: Sam Ravnborg <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2019-08-21drm: kirin: Fix dev->driver_data settingXu YiPing2-3/+1
As part of refactoring the kirin driver to better support different hardware revisions, this patch changes the dev->driver_data to point to a drm_device, not ade_data. Thus we set the driver data to drm device after alloc. Cc: Rongrong Zou <[email protected]> Cc: Xinliang Liu <[email protected]> Cc: David Airlie <[email protected]> Cc: Daniel Vetter <[email protected]> Cc: dri-devel <[email protected]> Cc: Sam Ravnborg <[email protected]> Acked-by: Xinliang Liu <[email protected]> Reviewed-by: Sam Ravnborg <[email protected]> Signed-off-by: Xu YiPing <[email protected]> [jstultz: Reworded commit message] Signed-off-by: John Stultz <[email protected]> Signed-off-by: Sam Ravnborg <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2019-08-21drm: kirin: Rename plane_init and crtc_initXu YiPing1-7/+10
As part of refactoring the kirin driver to better support different hardware revisions, this patch renames ade_crtc/plane_init kirin_plane/crtc_init, as they will later be moved to kirin drm drv and shared with the kirin960 hardware support. Cc: Rongrong Zou <[email protected]> Cc: Xinliang Liu <[email protected]> Cc: David Airlie <[email protected]> Cc: Daniel Vetter <[email protected]> Cc: dri-devel <[email protected]> Cc: Sam Ravnborg <[email protected]> Acked-by: Xinliang Liu <[email protected]> Reviewed-by: Sam Ravnborg <[email protected]> Signed-off-by: Xu YiPing <[email protected]> [jstultz: reworded commit message] Signed-off-by: John Stultz <[email protected]> Signed-off-by: Sam Ravnborg <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2019-08-21drm: kirin: Add register connect helper functions in drm initXu YiPing3-0/+45
As part of refactoring the kirin driver to better support different hardware revisions, this patch adds a flag to the device specific driver data so that we can conditionally register the connectors at init. Cc: Rongrong Zou <[email protected]> Cc: Xinliang Liu <[email protected]> Cc: David Airlie <[email protected]> Cc: Daniel Vetter <[email protected]> Cc: dri-devel <[email protected]> Cc: Sam Ravnborg <[email protected]> Acked-by: Xinliang Liu <[email protected]> Reviewed-by: Sam Ravnborg <[email protected]> Signed-off-by: Xu YiPing <[email protected]> [jstultz: reworded commit message] Signed-off-by: John Stultz <[email protected]> Signed-off-by: Sam Ravnborg <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2019-08-21drm: kirin: Move drm driver to driver dataXu YiPing3-34/+26
As part of refactoring the kirin driver to better support different hardware revisions, this patch moves the drm_driver structure to be under device specific driver data. This will allow us to more easily add support for kirin960 hardware with later patches. Cc: Rongrong Zou <[email protected]> Cc: Xinliang Liu <[email protected]> Cc: David Airlie <[email protected]> Cc: Daniel Vetter <[email protected]> Cc: dri-devel <[email protected]> Cc: Sam Ravnborg <[email protected]> Acked-by: Xinliang Liu <[email protected]> Reviewed-by: Sam Ravnborg <[email protected]> Signed-off-by: Xu YiPing <[email protected]> [jstultz: Reworded commit message] Signed-off-by: John Stultz <[email protected]> Signed-off-by: Sam Ravnborg <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2019-08-21drm: kirin: Move config max_width and max_height to driver dataXu YiPing3-12/+9
As part of refactoring the kirin driver to better support different hardware revisions, this patch moves the max_width and max_height values used in kirin_drm_mode_config_inita to hardware specific driver data. This will make it easier to add support for new devices via a new kirin_drm_data structure. Cc: Rongrong Zou <[email protected]> Cc: Xinliang Liu <[email protected]> Cc: David Airlie <[email protected]> Cc: Daniel Vetter <[email protected]> Cc: dri-devel <[email protected]> Cc: Sam Ravnborg <[email protected]> Acked-by: Xinliang Liu <[email protected]> Reviewed-by: Sam Ravnborg <[email protected]> Signed-off-by: Xu YiPing <[email protected]> [jstultz: reworded commit message] Signed-off-by: John Stultz <[email protected]> Signed-off-by: Sam Ravnborg <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2019-08-21drm: kirin: Move plane number and primay plane in driver dataXu YiPing2-8/+15
As part of refactoring the kirin driver to better support different hardware revisions, this patch moves the number of planes and the primary plane value to the kirin_drm_data structure This will make it easier to add support for new devices via a new kirin_drm_data structure. Cc: Rongrong Zou <[email protected]> Cc: Xinliang Liu <[email protected]> Cc: David Airlie <[email protected]> Cc: Daniel Vetter <[email protected]> Cc: dri-devel <[email protected]> Cc: Sam Ravnborg <[email protected]> Acked-by: Xinliang Liu <[email protected]> Reviewed-by: Sam Ravnborg <[email protected]> Signed-off-by: Xu YiPing <[email protected]> Signed-off-by: John Stultz <[email protected]> Signed-off-by: Sam Ravnborg <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2019-08-21drm: kirin: Move mode config function to driver_dataXu YiPing3-8/+12
As part of refactoring the kirin driver to better support different hardware revisions, this patch moves the mode config initialization values into the kirin_drm_data structure. This will make it easier to add support for new devices via a new kirin_drm_data structure. Cc: Rongrong Zou <[email protected]> Cc: Xinliang Liu <[email protected]> Cc: David Airlie <[email protected]> Cc: Daniel Vetter <[email protected]> Cc: dri-devel <[email protected]> Cc: Sam Ravnborg <[email protected]> Acked-by: Xinliang Liu <[email protected]> Reviewed-by: Sam Ravnborg <[email protected]> Signed-off-by: Xu YiPing <[email protected]> Signed-off-by: John Stultz <[email protected]> Signed-off-by: Sam Ravnborg <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2019-08-21drm: kirin: Move channel formats to driver dataXu YiPing2-23/+10
As part of refactoring the kirin driver to better support different hardware revisions, this patch moves the channel format arrays into the kirin_drm_data structure. This will make it easier to add support for new devices via a new kirin_drm_data structure. Cc: Rongrong Zou <[email protected]> Cc: Xinliang Liu <[email protected]> Cc: David Airlie <[email protected]> Cc: Daniel Vetter <[email protected]> Cc: dri-devel <[email protected]> Cc: Sam Ravnborg <[email protected]> Acked-by: Xinliang Liu <[email protected]> Reviewed-by: Sam Ravnborg <[email protected]> Signed-off-by: Xu YiPing <[email protected]> [jstultz: reworded commit message] Signed-off-by: John Stultz <[email protected]> Signed-off-by: Sam Ravnborg <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2019-08-21drm: kirin: Move ade crtc/plane help functions to driver_dataXu YiPing2-5/+15
As part of refactoring the kirin driver to better support different hardware revisions, this patch moves the crtc and plane funcs/helper_funcs to the struct kirin_drm_data. This will make it easier to add support for new devices via a new kirin_drm_data structure. Cc: Rongrong Zou <[email protected]> Cc: Xinliang Liu <[email protected]> Cc: David Airlie <[email protected]> Cc: Daniel Vetter <[email protected]> Cc: dri-devel <[email protected]> Cc: Sam Ravnborg <[email protected]> Acked-by: Xinliang Liu <[email protected]> Reviewed-by: Sam Ravnborg <[email protected]> Signed-off-by: Xu YiPing <[email protected]> [jstultz: reworded commit message] Signed-off-by: John Stultz <[email protected]> Signed-off-by: Sam Ravnborg <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2019-08-21drm: kirin: Reanme dc_ops to kirin_drm_dataXu YiPing3-11/+11
As part of refactoring the kirin driver to better support different hardware revisions, this patch renames the struct kirin_dc_ops to struct kirin_drm_data and cleans up the related variable names. Cc: Rongrong Zou <[email protected]> Cc: Xinliang Liu <[email protected]> Cc: David Airlie <[email protected]> Cc: Daniel Vetter <[email protected]> Cc: dri-devel <[email protected]> Cc: Sam Ravnborg <[email protected]> Acked-by: Xinliang Liu <[email protected]> Reviewed-by: Sam Ravnborg <[email protected]> Signed-off-by: Xu YiPing <[email protected]> [jstultz: reworded commit message] Signed-off-by: John Stultz <[email protected]> Signed-off-by: Sam Ravnborg <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2019-08-21drm: kirin: Move kirin_crtc, kirin_plane, kirin_format to kirin_drm_drv.hXu YiPing2-25/+26
As part of refactoring the kirin driver to better support different hardware revisions, this patch moves some shared structures and helpers to the common kirin_drm_drv.h These structures will later used by both kirin620 and future kirin960 driver Cc: Rongrong Zou <[email protected]> Cc: Xinliang Liu <[email protected]> Cc: David Airlie <[email protected]> Cc: Daniel Vetter <[email protected]> Cc: dri-devel <[email protected]> Cc: Sam Ravnborg <[email protected]> Acked-by: Xinliang Liu <[email protected]> Reviewed-by: Sam Ravnborg <[email protected]> Signed-off-by: Xu YiPing <[email protected]> [jstultz: reworded commit message] Signed-off-by: John Stultz <[email protected]> Signed-off-by: Sam Ravnborg <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2019-08-21drm: kirin: Move workqueue to ade_hw_ctx structureJohn Stultz1-7/+5
The workqueue used to reset the display when we hit an LDI underflow error is ADE specific, so since this patch series works to make the kirin_crtc structure more generic, move the workqueue to the ade_hw_ctx structure instead. Cc: Rongrong Zou <[email protected]> Cc: Xinliang Liu <[email protected]> Cc: David Airlie <[email protected]> Cc: Daniel Vetter <[email protected]> Cc: dri-devel <[email protected]> Cc: Sam Ravnborg <[email protected]> Acked-by: Xinliang Liu <[email protected]> Reviewed-by: Sam Ravnborg <[email protected]> Signed-off-by: John Stultz <[email protected]> Signed-off-by: Sam Ravnborg <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2019-08-21drm: kirin: Move request irq handle in ade hw ctx allocXu YiPing1-12/+17
As part of refactoring the kirin driver to better support different hardware revisions, this patch modifies the initialization routines so the devm_request_irq() function is called as part of the allocation function. This will be needed in the future when we will have different allocation functions to allocate hardware specific hw_ctx structures, which will setup the vblank irq differently. Cc: Rongrong Zou <[email protected]> Cc: Xinliang Liu <[email protected]> Cc: David Airlie <[email protected]> Cc: Daniel Vetter <[email protected]> Cc: dri-devel <[email protected]> Cc: Sam Ravnborg <[email protected]> Acked-by: Xinliang Liu <[email protected]> Reviewed-by: Sam Ravnborg <[email protected]> Signed-off-by: Xu YiPing <[email protected]> [jstultz: reworded commit message] Signed-off-by: John Stultz <[email protected]> Signed-off-by: Sam Ravnborg <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2019-08-21drm: kirin: Dynamically allocate the hw_ctxXu YiPing1-15/+24
As part of refactoring the kirin driver to better support different hardware revisions, this patch modifies the initialization function to dynamically allocate the ade_hw_ctx structure previously kept as part of struct ade_data. This is done so that later we can have the hw_ctx point to hardware revision specific ctx structures. Cc: Rongrong Zou <[email protected]> Cc: Xinliang Liu <[email protected]> Cc: David Airlie <[email protected]> Cc: Daniel Vetter <[email protected]> Cc: dri-devel <[email protected]> Cc: Sam Ravnborg <[email protected]> Acked-by: Xinliang Liu <[email protected]> Reviewed-by: Sam Ravnborg <[email protected]> Signed-off-by: Xu YiPing <[email protected]> [jstultz: reworded commit message] Signed-off-by: John Stultz <[email protected]> Signed-off-by: Sam Ravnborg <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2019-08-21drm: kirin: Rename ade_crtc to kirin_crtcXu YiPing1-37/+37
As part of refactoring the kirin driver to better support different hardware revisions, this patch renames the struct ade_crtc to kirin_crtc. The struct kirin_crtc will later used by both kirin620 and future kirin960 driver, and will be moved to a common kirin_drm_drv.h in a future patch Cc: Rongrong Zou <[email protected]> Cc: Xinliang Liu <[email protected]> Cc: David Airlie <[email protected]> Cc: Daniel Vetter <[email protected]> Cc: dri-devel <[email protected]> Cc: Sam Ravnborg <[email protected]> Acked-by: Xinliang Liu <[email protected]> Reviewed-by: Sam Ravnborg <[email protected]> Signed-off-by: Xu YiPing <[email protected]> [jstultz: reworded commit message] Signed-off-by: John Stultz <[email protected]> Signed-off-by: Sam Ravnborg <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2019-08-21drm: kirin: Rename ade_plane to kirin_planeXu YiPing1-28/+29
As part of refactoring the kirin driver to better support different hardware revisions, this patch renames the struct ade_plane to kirin_plane. The struct kirin_plane will later used by both kirin620 and future kirin960 driver, and will be moved to a common kirin_drm_drv.h in a future patch Cc: Rongrong Zou <[email protected]> Cc: Xinliang Liu <[email protected]> Cc: David Airlie <[email protected]> Cc: Daniel Vetter <[email protected]> Cc: dri-devel <[email protected]> Cc: Sam Ravnborg <[email protected]> Acked-by: Xinliang Liu <[email protected]> Reviewed-by: Sam Ravnborg <[email protected]> Signed-off-by: Xu YiPing <[email protected]> [jstultz: reworded commit message] Signed-off-by: John Stultz <[email protected]> Signed-off-by: Sam Ravnborg <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2019-08-21drm: kirin: Remove out_format from ade_crtcXu YiPing1-6/+3
As part of refactoring the kirin driver to better support different hardware revisions, this patch removes the out_format field in the struct ade_crtc, which was only ever set to LDI_OUT_RGB_888. Thus this patch removes the field and instead directly uses LDI_OUT_RGB_888. Cc: Rongrong Zou <[email protected]> Cc: Xinliang Liu <[email protected]> Cc: David Airlie <[email protected]> Cc: Daniel Vetter <[email protected]> Cc: dri-devel <[email protected]> Cc: Sam Ravnborg <[email protected]> Acked-by: Xinliang Liu <[email protected]> Reviewed-by: Sam Ravnborg <[email protected]> Signed-off-by: Xu YiPing <[email protected]> [jstultz: reworded commit message] Signed-off-by: John Stultz <[email protected]> Signed-off-by: Sam Ravnborg <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2019-08-21drm: kirin: Remove uncessary parameter indirectionXu YiPing1-7/+5
In a few functions, we pass in a struct ade_crtc, which we only use to get to the underlying struct ade_hw_ctx. Thus this patch refactors the functions to just take the struct ade_hw_ctx directly. Cc: Rongrong Zou <[email protected]> Cc: Xinliang Liu <[email protected]> Cc: David Airlie <[email protected]> Cc: Daniel Vetter <[email protected]> Cc: dri-devel <[email protected]> Cc: Sam Ravnborg <[email protected]> Acked-by: Xinliang Liu <[email protected]> Reviewed-by: Sam Ravnborg <[email protected]> Signed-off-by: Xu YiPing <[email protected]> [jstultz: reworded commit message] Signed-off-by: John Stultz <[email protected]> Signed-off-by: Sam Ravnborg <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2019-08-21drm: kirin: Remove unreachable returnJohn Stultz1-2/+0
The 'return 0' in kirin_drm_platform_probe() is unreachable code, so remove it. Cc: Rongrong Zou <[email protected]> Cc: Xinliang Liu <[email protected]> Cc: David Airlie <[email protected]> Cc: Daniel Vetter <[email protected]> Cc: dri-devel <[email protected]> Cc: Sam Ravnborg <[email protected]> Acked-by: Xinliang Liu <[email protected]> Reviewed-by: Sam Ravnborg <[email protected]> Suggested by: Xu YiPing <[email protected]> Signed-off-by: John Stultz <[email protected]> Signed-off-by: Sam Ravnborg <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2019-08-21drm: kirin: Remove HISI_KIRIN_DW_DSI config optionJohn Stultz2-11/+2
The CONFIG_HISI_KIRIN_DW_DSI option is only used w/ kirin driver, so cut out the middleman and condense the config logic down. Cc: Rongrong Zou <[email protected]> Cc: Xinliang Liu <[email protected]> Cc: David Airlie <[email protected]> Cc: Daniel Vetter <[email protected]> Cc: dri-devel <[email protected]> Cc: Sam Ravnborg <[email protected]> Acked-by: Xinliang Liu <[email protected]> Reviewed-by: Sam Ravnborg <[email protected]> Signed-off-by: John Stultz <[email protected]> Signed-off-by: Sam Ravnborg <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2019-08-21drm: kirin: Fix for hikey620 display offset problemDa Lv2-0/+23
The original HiKey (620) board has had a long running issue where when using a 1080p montior, the display would occasionally blink and come come back with a horizontal offset (usually also shifting the colors, depending on the value of the offset%4). After lots of analysis by HiSi developers, they found the issue was due to when running at 1080p, it was possible to hit the device memory bandwidth limits, which could cause the DSI signal to get out of sync. Unfortunately the DSI logic doesn't have the ability to automatically recover from this situation, but we can get a an LDI underflow interrupt when it happens. To then correct the issue, when we get an LDI underflow irq, we we can simply suspend and resume the display, which resets the hardware. Thus, this patch enables the ldi underflow interrupt, and initializes a workqueue that is used to suspend/resume the display to recover. Then when the irq occurs we clear it and schedule the workqueue to reset display engine. Cc: Rongrong Zou <[email protected]> Cc: Xinliang Liu <[email protected]> Cc: David Airlie <[email protected]> Cc: Daniel Vetter <[email protected]> Cc: dri-devel <[email protected]> Cc: Sam Ravnborg <[email protected]> Acked-by: Xinliang Liu <[email protected]> Reviewed-by: Sam Ravnborg <[email protected]> Signed-off-by: Da Lv <[email protected]> Signed-off-by: Yidong Lin <[email protected]> [jstultz: Reworded the commit message, checkpatch cleanups] Signed-off-by: John Stultz <[email protected]> Signed-off-by: Sam Ravnborg <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2019-08-21drm/i915: Don't deballoon unused ggtt drm_mm_node in linux guestXiong Zhang1-0/+3
The following call trace may exist in linux guest dmesg when guest i915 driver is unloaded. [ 90.776610] [drm:vgt_deballoon_space.isra.0 [i915]] deballoon space: range [0x0 - 0x0] 0 KiB. [ 90.776621] BUG: unable to handle kernel NULL pointer dereference at 00000000000000c0 [ 90.776691] IP: drm_mm_remove_node+0x4d/0x320 [drm] [ 90.776718] PGD 800000012c7d0067 P4D 800000012c7d0067 PUD 138e4c067 PMD 0 [ 90.777091] task: ffff9adab60f2f00 task.stack: ffffaf39c0fe0000 [ 90.777142] RIP: 0010:drm_mm_remove_node+0x4d/0x320 [drm] [ 90.777573] Call Trace: [ 90.777653] intel_vgt_deballoon+0x4c/0x60 [i915] [ 90.777729] i915_ggtt_cleanup_hw+0x121/0x190 [i915] [ 90.777792] i915_driver_unload+0x145/0x180 [i915] [ 90.777856] i915_pci_remove+0x15/0x20 [i915] [ 90.777890] pci_device_remove+0x3b/0xc0 [ 90.777916] device_release_driver_internal+0x157/0x220 [ 90.777945] driver_detach+0x39/0x70 [ 90.777967] bus_remove_driver+0x51/0xd0 [ 90.777990] pci_unregister_driver+0x23/0x90 [ 90.778019] SyS_delete_module+0x1da/0x240 [ 90.778045] entry_SYSCALL_64_fastpath+0x24/0x87 [ 90.778072] RIP: 0033:0x7f34312af067 [ 90.778092] RSP: 002b:00007ffdea3da0d8 EFLAGS: 00000206 [ 90.778297] RIP: drm_mm_remove_node+0x4d/0x320 [drm] RSP: ffffaf39c0fe3dc0 [ 90.778344] ---[ end trace f4b1bc8305fc59dd ]--- Four drm_mm_node are used to reserve guest ggtt space, but some of them may be skipped and not initialised due to space constraints in intel_vgt_balloon(). If drm_mm_remove_node() is called with uninitialized drm_mm_node, the above call trace occurs. This patch check drm_mm_node's validity before calling drm_mm_remove_node(). Fixes: ff8f797557c7("drm/i915: return the correct usable aperture size under gvt environment") Cc: [email protected] Signed-off-by: Xiong Zhang <[email protected]> Acked-by: Zhenyu Wang <[email protected]> Reviewed-by: Chris Wilson <[email protected]> Signed-off-by: Chris Wilson <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2019-08-21drm/i915/gtt: Add some range assertsChris Wilson1-5/+11
These should have been validated in the upper layers, but for sanity's sake, repeat them. Signed-off-by: Chris Wilson <[email protected]> Reviewed-by: Mika Kuoppala <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2019-08-21drm/i915: Do not create a new max_bpc prop for MST connectorsVille Syrjälä1-1/+9
We're not allowed to create new properties after device registration so for MST connectors we need to either create the max_bpc property earlier, or we reuse one we already have. Let's do the latter apporach since the corresponding SST connector already has the prop and its min/max are correct also for the MST connector. The problem was highlighted by commit 4f5368b5541a ("drm/kms: Catch mode_object lifetime errors") which results in the following spew: [ 1330.878941] WARNING: CPU: 2 PID: 1554 at drivers/gpu/drm/drm_mode_object.c:45 __drm_mode_object_add+0xa0/0xb0 [drm] ... [ 1330.879008] Call Trace: [ 1330.879023] drm_property_create+0xba/0x180 [drm] [ 1330.879036] drm_property_create_range+0x15/0x30 [drm] [ 1330.879048] drm_connector_attach_max_bpc_property+0x62/0x80 [drm] [ 1330.879086] intel_dp_add_mst_connector+0x11f/0x140 [i915] [ 1330.879094] drm_dp_add_port.isra.20+0x20b/0x440 [drm_kms_helper] ... Cc: [email protected] Cc: Lyude Paul <[email protected]> Cc: [email protected] Cc: Daniel Vetter <[email protected]> Cc: Sean Paul <[email protected]> Fixes: 5ca0ef8a56b8 ("drm/i915: Add max_bpc property for DP MST") Signed-off-by: Ville Syrjälä <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] Reviewed-by: José Roberto de Souza <[email protected]> Reviewed-by: Lyude Paul <[email protected]>
2019-08-21drm/i915/execlists: Set priority hint prior to submissionChris Wilson1-1/+1
Since we now run process_csb() outside of the engine->active.lock, we can process a CS-event immediately upon our ELSP write. As we currently inspect the pending queue *after* the ELSP write, there is an opportunity for a CS-event to update the pending queue before we can read it, making ourselves chases an invalid pointer. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=111427 Fixes: df403069029d ("drm/i915/execlists: Lift process_csb() out of the irq-off spinlock") Signed-off-by: Chris Wilson <[email protected]> Cc: Mika Kuoppala <[email protected]> Reviewed-by: Mika Kuoppala <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2019-08-21drm/i915: Replace PIN_NONFAULT with calls to PIN_NOEVICTChris Wilson6-22/+18
When under severe stress for GTT mappable space, the LRU eviction model falls off a cliff. We spend all our time scanning the much larger non-mappable area searching for something within the mappable zone we can evict. Turn this on its head by only using the full vma for the object if it is already pinned in the mappable zone or there is sufficient *free* space to accommodate it (prioritizing speedy reuse). If there is not, immediately fall back to using small chunks (tilerow for GTT mmap, single pages for pwrite/relocation) and using random eviction before doing a full search. Testcase: igt/gem_concurrent_blt References: https://bugs.freedesktop.org/show_bug.cgi?id=110848 Signed-off-by: Chris Wilson <[email protected]> Reviewed-by: Matthew Auld <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2019-08-21drm/nouveau: Initialize GEM object before TTM objectThierry Reding4-41/+77
TTM assumes that drivers initialize the embedded GEM object before calling the ttm_bo_init() function. This is not currently the case in the Nouveau driver. Fix this by splitting up nouveau_bo_new() into nouveau_bo_alloc() and nouveau_bo_init() so that the GEM can be initialized before TTM BO initialization when necessary. Fixes: b96f3e7c8069 ("drm/ttm: use gem vma_node") Acked-by: Gerd Hoffmann <[email protected]> Acked-by: Ben Skeggs <[email protected]> Signed-off-by: Thierry Reding <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/20190814093524.GA31345@ulmo
2019-08-21drm/i915/gtt: Include asm/smp.hChris Wilson1-0/+1
We need asm/smp.h for wbinvd_on_all_cpus() Reported-by: [email protected] Signed-off-by: Chris Wilson <[email protected]> Cc: Matthew Auld <[email protected]> Reviewed-by: Matthew Auld <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2019-08-21drm/i915/hdmi: make hdcp2_msg_data constJani Nikula1-1/+1
It's static const data, make it so. Cc: Ramalingam C <[email protected]> Reviewed-by: Ramalingam C <[email protected]> Signed-off-by: Jani Nikula <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2019-08-21drm/i915/hdmi: stylistic cleanup around hdcp2_msg_dataJani Nikula1-20/+19
Split struct declaration and array definition. Fix indents and whitespace. No functional changes. Cc: Ramalingam C <[email protected]> Reviewed-by: Ramalingam C <[email protected]> Signed-off-by: Jani Nikula <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2019-08-21drm/i915/dp: make hdcp2_dp_msg_data constJani Nikula1-5/+5
It's static const data, make it so. Cc: Ramalingam C <[email protected]> Reviewed-by: Ramalingam C <[email protected]> Signed-off-by: Jani Nikula <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2019-08-21drm/i915/dp: avoid shadowing variablesJani Nikula1-4/+4
Everything seems to be all right, but shadowing is to be avoided. Cc: Ramalingam C <[email protected]> Reviewed-by: Ramalingam C <[email protected]> Signed-off-by: Jani Nikula <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2019-08-21drm/i915/dp: stylistic cleanup around hdcp2_msg_dataJani Nikula1-34/+36
Split struct declaration and array definition. Fix indents and whitespace. No functional changes. Cc: Ramalingam C <[email protected]> Reviewed-by: Ramalingam C <[email protected]> Signed-off-by: Jani Nikula <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2019-08-21drm/i915/gtt: Relax assertion for pt_usedChris Wilson1-1/+2
When inserting the final level PTE, we check that we are not overflowing the page table (checking that pt_used does not exceed the size of the table). However, we have to allow for every other PTE to be pinned by a simultaneous removal thread (as on remove we bump the pt_used counter before adjusting the table). Signed-off-by: Chris Wilson <[email protected]> Cc: Mika Kuoppala <[email protected]> Reviewed-by: Mika Kuoppala <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2019-08-21Merge tag 'drm-misc-next-2019-08-19' of ↵Dave Airlie223-3844/+5062
git://anongit.freedesktop.org/drm/drm-misc into drm-next drm-misc-next for 5.4: UAPI Changes: Cross-subsystem Changes: Core Changes: - dma-buf: add reservation_object_fences helper, relax reservation_object_add_shared_fence, remove reservation_object seq number (and then restored) - dma-fence: Shrinkage of the dma_fence structure, Merge dma_fence_signal and dma_fence_signal_locked, Store the timestamp in struct dma_fence in a union with cb_list Driver Changes: - More dt-bindings YAML conversions - More removal of drmP.h includes - dw-hdmi: Support get_eld and various i2s improvements - gm12u320: Few fixes - meson: Global cleanup - panfrost: Few refactors, Support for GPU heap allocations - sun4i: Support for DDC enable GPIO - New panels: TI nspire, NEC NL8048HL11, LG Philips LB035Q02, Sharp LS037V7DW01, Sony ACX565AKM, Toppoly TD028TTEC1 Toppoly TD043MTEA1 Signed-off-by: Dave Airlie <[email protected]> [airlied: fixup dma_resv rename fallout] From: Maxime Ripard <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/20190819141923.7l2adietcr2pioct@flea
2019-08-20drm/i915: Fix DP-MST crtc_maskVille Syrjälä1-1/+1
Each fake MST encoder is tied to a specific pipe. Fix the encoder's crtc_mask to reflect that fact. Signed-off-by: Ville Syrjälä <[email protected]> Reviewed-by: Dhinakaran Pandiyan <[email protected]> Reviewed-by: Ville Syrjälä <[email protected]> Signed-off-by: Lucas De Marchi <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2019-08-20drm/i915/tgl: update DMC firmware to 2.04Lucas De Marchi1-2/+2
2 important fixes: - vblank counter is now working - PSR1 is working Cc: Jose Souza <[email protected]> Cc: Anusha Srivatsa <[email protected]> Signed-off-by: Lucas De Marchi <[email protected]> Reviewed-by: Anusha Srivatsa <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2019-08-20drm/i915/tgl: Move transcoders to pipes' powerwellsJosé Roberto de Souza1-2/+2
When trying to read registers from transcoder C and D while PG3 is ON it causes unclaimed access warnings. Adding the powerwells for the pipes fixes the issue, but doesn't match the spec. Signed-off-by: José Roberto de Souza <[email protected]> Signed-off-by: Lucas De Marchi <[email protected]> Reviewed-by: Imre Deak <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2019-08-20drm/i915/tgl: add support for reading the timestamp frequencyMichel Thierry1-1/+1
There are no changes with respect to GEN11, which Paulo wrote. This gets rid of the "Missing switch case in read_timestamp_frequency" message at boot for Tiger Lake. [ Lucas: BSpec: 10742 and 9024, but there's a mismatch on the values. Let's say a glitch in the spec. Tested locally and it works. ] Cc: Paulo Zanoni <[email protected]> Cc: Lionel Landwerlin <[email protected]> Signed-off-by: Michel Thierry <[email protected]> Reviewed-by: Lucas De Marchi <[email protected]> Signed-off-by: Lucas De Marchi <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2019-08-20drm/i915/tgl: disable DDICLucas De Marchi1-2/+1
The current SKUs added for Tiger Lake don't have DDIC hooked up, even though it is supported by the SoC. The current state for these SKUs is problematic since while enabling the combo phy, PORT_COMP_DW* return 0xFFFFFFFF, which is invalid per register definition. During initialization we check what phys are not yet enabled by reading PHY_MISC_C and try to enable it by toggling the "DE to IO Comp Pwr Down" bit. But after that any read to the PORT_COMP_DW* returns invalid results. This removes the following warning [56997.634353] Missing case (val == 4294967295) [56997.639241] WARNING: CPU: 5 PID: 768 at drivers/gpu/drm/i915/display/intel_combo_phy.c:54 cnl_get_procmon_ref_values+0xc9/0xf0 [i915] [56997.639808] Modules linked in: i915(+) prime_numbers x86_pkg_temp_thermal coretemp kvm_intel kvm irqbypass crct10dif_pclmul crc32_pclmul ghash_clmulni_intel e1000e [last unloaded: prime_numbers] [56997.639808] CPU: 5 PID: 768 Comm: insmod Tainted: G U W 5.2.0-demarchi+ #65 [56997.639808] Hardware name: Intel Corporation Tiger Lake Client Platform/TigerLake U DDR4 SODIMM RVP, BIOS TGLSFWI1.R00.2252.A03.1906270154 06/27/2019 [56997.639808] RIP: 0010:cnl_get_procmon_ref_values+0xc9/0xf0 [i915] [56997.639808] Code: 2c a0 85 c9 74 e0 81 f9 00 00 00 01 75 09 48 c7 c0 0c a4 2c a0 eb cf 48 c7 c6 3c 3a 31 a0 48 c7 c7 40 3a 31 a0 e8 6b 4d ea e0 <0f> 0b 48 c7 c0 00 a4 2c a0 eb b1 48 c7 c0 24 a4 2 c a0 eb a8 e8 be [56997.639808] RSP: 0018:ffffc9000068f8a8 EFLAGS: 00010286 [56997.639808] RAX: 0000000000000000 RBX: ffff88848fa90000 RCX: 0000000000000000 [56997.639808] RDX: ffff8884a08b5ef8 RSI: ffff8884a08a6658 RDI: 00000000ffffffff [56997.639808] RBP: 0000000000000002 R08: 0000000000000000 R09: 0000000000000000 [56997.639808] R10: 0000000000000000 R11: 0000000000000000 R12: ffff88848fa90000 [56997.639808] R13: 0000000000000000 R14: 0000000000000002 R15: 0006c00000162000 [56997.639808] FS: 00007f61ca3d12c0(0000) GS:ffff8884a0880000(0000) knlGS:0000000000000000 [56997.639808] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [56997.639808] CR2: 00007f71be6a92c0 CR3: 0000000494750006 CR4: 0000000000760ee0 [56997.639808] PKRU: 55555554 [56997.639808] Call Trace: [56997.639808] cnl_verify_procmon_ref_values+0x36/0xf0 [i915] [56997.639808] ? rcu_read_lock_sched_held+0x6f/0x80 [56997.639808] ? gen11_fwtable_read32+0x257/0x290 [i915] [56997.639808] icl_combo_phy_verify_state.part.0+0x22/0xa0 [i915] [56997.639808] intel_combo_phy_init+0x17e/0x3e0 [i915] [56997.639808] ? icl_display_core_init+0x2c/0x1a0 [i915] [56997.639808] ? _raw_spin_unlock_irqrestore+0x4c/0x60 [56997.639808] icl_display_core_init+0x34/0x1a0 [i915] [56997.639808] intel_power_domains_init_hw+0x200/0x570 [i915] [56997.639808] i915_driver_probe+0x103b/0x17e0 [i915] [56997.639808] ? printk+0x53/0x6a [56997.639808] i915_pci_probe+0x3b/0x190 [i915] We may or may not need to change the implementation to account for DDIC being available on other SKUs. For now I think the best thing to do is to just disable the port. Cc: José Roberto de Souza <[email protected]> Signed-off-by: Lucas De Marchi <[email protected]> Reviewed-by: Uma Shankar <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2019-08-20drm/i915: Update DRIVER_DATE to 20190820Rodrigo Vivi1-2/+2
Signed-off-by: Rodrigo Vivi <[email protected]>
2019-08-20dt-bindings: display: rockchip: update DSI controllerNickey Yang1-2/+21
This patch update describe panel/port links, including unit addresses in documentation of device tree bindings for the rockchip DSI controller based on the Synopsys DesignWare MIPI DSI host controller. Signed-off-by: Nickey Yang <[email protected]> Reviewed-by: Brian Norris <[email protected]> Reviewed-by: Rob Herring <[email protected]> [this seems to have gotten lost when the original dsi-series was applied] Signed-off-by: Heiko Stuebner <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2019-08-20drm/i915/gtt: Relax pd_used assertionChris Wilson1-1/+2
The current assertion tries to make sure that we do not over count the number of used PDE inside a page directory -- that is with an array of 512 pde, we do not expect more than 512 elements used! However, our assertion has to take into account that as we pin an element into the page directory, the caller first pins the page directory so the usage count is one higher. However, this should be one extra pin per thread, and the upper bound is that we may have one thread for each entry. Signed-off-by: Chris Wilson <[email protected]> Cc: Mika Kuoppala <[email protected]> Reviewed-by: Mika Kuoppala <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2019-08-20drm/i915: Dynamically allocate s0ix struct for VLVDaniele Ceraolo Spurio2-70/+106
This is only required for a single platform so no need to reserve the memory on all of them. This removes the last direct dependency of i915_drv.h on i915_reg.h (apart from the i915_reg_t definition). v2: drop unneeded diff, keep the vlv prefix, call functions unconditionally (Jani), fwd declaration of the struct (Chris) Signed-off-by: Daniele Ceraolo Spurio <[email protected]> Cc: Imre Deak <[email protected]> Cc: Jani Nikula <[email protected]> Cc: Chris Wilson <[email protected]> Reviewed-by: Chris Wilson <[email protected]> Signed-off-by: Chris Wilson <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2019-08-20drm/i915/tgl: Gen12 render context sizeDaniele Ceraolo Spurio1-0/+1
Re-use Gen11 context size for now. [ Lucas: this is a temporary enabling patch that needs to be confirmed: we need to check BSpec 46255 and recompute ] Signed-off-by: Daniele Ceraolo Spurio <[email protected]> Signed-off-by: Lucas De Marchi <[email protected]> Acked-by: Chris Wilson <[email protected]> Signed-off-by: Chris Wilson <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2019-08-20drm/i915/tgl: Updated Private PAT programmingMichel Thierry2-1/+17
Gen12 removes the target-cache and age fields from the private PAT because MOCS now have the capability to set these itself. Only memory-type field should be programmed in the ppat, the reminded bits are reserved. Since now there are only 4 possible combinations, we could set only 4 PPAT and leave the reminded 4 as UC, but I left them as WB as we used to have before. Also these registers have been relocated to the 0x4800-0x481c range. HSDES: 1406402661 BSpec: 31654 Cc: Daniele Ceraolo Spurio <[email protected]> Signed-off-by: Michel Thierry <[email protected]> Signed-off-by: Lucas De Marchi <[email protected]> Reviewed-by: Chris Wilson <[email protected]> Signed-off-by: Chris Wilson <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2019-08-20drm/i915/tgl: Introduce initial Tiger Lake workaroundsLucas De Marchi3-4/+27
Add empty workaround hooks for Tiger Lake. The workarounds will be added on separate patches. We were already applying WaRsForcewakeAddDelayForAck, which is indeed still valid, so also update the comment. Cc: Daniele Ceraolo Spurio <[email protected]> Signed-off-by: Lucas De Marchi <[email protected]> Reviewed-by: Radhakrishna Sripada <[email protected]> Signed-off-by: Chris Wilson <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]