aboutsummaryrefslogtreecommitdiff
path: root/drivers/gpu
AgeCommit message (Collapse)AuthorFilesLines
2020-09-14drm/i915: Nuke CACHE_MODE_0 save/restoreVille Syrjälä2-10/+0
The CACHE_MODE_0 save/restore was added without explanation in commit 1f84e550a870 ("drm/i915 more registers for S3 (DSPCLK_GATE_D, CACHE_MODE_0, MI_ARB_STATE)"). If there are any bits we care about those should be set explicitly during some appropriate init function. Let's assume it's all good and just nuke this magic save/restore. Signed-off-by: Ville Syrjälä <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] Acked-by: Jani Nikula <[email protected]>
2020-09-14drm/i915: Nuke MI_ARB_STATE save/restoreVille Syrjälä2-7/+0
Originally added in commit 1f84e550a870 ("drm/i915 more registers for S3 (DSPCLK_GATE_D, CACHE_MODE_0, MI_ARB_STATE)") to fix some underruns. I suspect that was due to the trickle feed settings getting clobbered during suspend. We've been disabling trickle feed explicitly since commit 20f949670f51 ("drm/i915: Disable trickle feed via MI_ARB_STATE for the gen4") so this magic save/restore should no longer be needed. Signed-off-by: Ville Syrjälä <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] Reviewed-by: Jani Nikula <[email protected]>
2020-09-14drm/i915: Nuke the magic FBC_CONTROL save/restoreVille Syrjälä2-9/+0
The FBC_CONTROL save restore is there just to preserve the compression interval setting. Since commit a68ce21ba0c4 ("drm/i915/fbc: Store the fbc1 compression interval in the params") we've been explicitly setting the interval to a specific value, so the sace/restore is now entirely pointless. Signed-off-by: Ville Syrjälä <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] Reviewed-by: Jani Nikula <[email protected]>
2020-09-14drm/i915: Kill unused savePCH_PORT_HOTPLUGVille Syrjälä1-1/+0
We don't save/restore PCH_PORT_HOTPLUG so no point in reseving space for the value. Signed-off-by: Ville Syrjälä <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] Reviewed-by: Jani Nikula <[email protected]>
2020-09-14drm: fix double free for gbo in drm_gem_vram_init and drm_gem_vram_createJia Yang1-12/+16
I got a use-after-free report when doing some fuzz test: If ttm_bo_init() fails, the "gbo" and "gbo->bo.base" will be freed by ttm_buffer_object_destroy() in ttm_bo_init(). But then drm_gem_vram_create() and drm_gem_vram_init() will free "gbo" and "gbo->bo.base" again. BUG: KMSAN: use-after-free in drm_vma_offset_remove+0xb3/0x150 CPU: 0 PID: 24282 Comm: syz-executor.1 Tainted: G B W 5.7.0-rc4-msan #2 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Ubuntu-1.8.2-1ubuntu1 04/01/2014 Call Trace: __dump_stack dump_stack+0x1c9/0x220 kmsan_report+0xf7/0x1e0 __msan_warning+0x58/0xa0 drm_vma_offset_remove+0xb3/0x150 drm_gem_free_mmap_offset drm_gem_object_release+0x159/0x180 drm_gem_vram_init drm_gem_vram_create+0x7c5/0x990 drm_gem_vram_fill_create_dumb drm_gem_vram_driver_dumb_create+0x238/0x590 drm_mode_create_dumb drm_mode_create_dumb_ioctl+0x41d/0x450 drm_ioctl_kernel+0x5a4/0x710 drm_ioctl+0xc6f/0x1240 vfs_ioctl ksys_ioctl __do_sys_ioctl __se_sys_ioctl+0x2e9/0x410 __x64_sys_ioctl+0x4a/0x70 do_syscall_64+0xb8/0x160 entry_SYSCALL_64_after_hwframe+0x44/0xa9 RIP: 0033:0x4689b9 Code: fd e0 fa ff c3 66 2e 0f 1f 84 00 00 00 00 00 66 90 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 0f 83 cb e0 fa ff c3 66 2e 0f 1f 84 00 00 00 00 RSP: 002b:00007f368fa4dc98 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 RAX: ffffffffffffffda RBX: 000000000076bf00 RCX: 00000000004689b9 RDX: 0000000020000240 RSI: 00000000c02064b2 RDI: 0000000000000003 RBP: 0000000000000004 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00000000004d17e0 R14: 00007f368fa4e6d4 R15: 000000000076bf0c Uninit was created at: kmsan_save_stack_with_flags kmsan_internal_poison_shadow+0x66/0xd0 kmsan_slab_free+0x6e/0xb0 slab_free_freelist_hook slab_free kfree+0x571/0x30a0 drm_gem_vram_destroy ttm_buffer_object_destroy+0xc8/0x130 ttm_bo_release kref_put ttm_bo_put+0x117d/0x23e0 ttm_bo_init_reserved+0x11c0/0x11d0 ttm_bo_init+0x289/0x3f0 drm_gem_vram_init drm_gem_vram_create+0x775/0x990 drm_gem_vram_fill_create_dumb drm_gem_vram_driver_dumb_create+0x238/0x590 drm_mode_create_dumb drm_mode_create_dumb_ioctl+0x41d/0x450 drm_ioctl_kernel+0x5a4/0x710 drm_ioctl+0xc6f/0x1240 vfs_ioctl ksys_ioctl __do_sys_ioctl __se_sys_ioctl+0x2e9/0x410 __x64_sys_ioctl+0x4a/0x70 do_syscall_64+0xb8/0x160 entry_SYSCALL_64_after_hwframe+0x44/0xa9 If ttm_bo_init() fails, the "gbo" will be freed by ttm_buffer_object_destroy() in ttm_bo_init(). But then drm_gem_vram_create() and drm_gem_vram_init() will free "gbo" again. Reported-by: Hulk Robot <[email protected]> Reported-by: butt3rflyh4ck <[email protected]> Signed-off-by: Jia Yang <[email protected]> Signed-off-by: Thomas Zimmermann <[email protected]> Reviewed-by: Thomas Zimmermann <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2020-09-14drm/i915/gvt: Fix port number for BDW on EDID region setupZhenyu Wang1-1/+5
Current BDW virtual display port is initialized as PORT_B, so need to use same port for VFIO EDID region, otherwise invalid EDID blob pointer is assigned which caused kernel null pointer reference. We might evaluate actual display hotplug for BDW to make this function work as expected, anyway this is always required to be fixed first. Reported-by: Alejandro Sior <[email protected]> Cc: Alejandro Sior <[email protected]> Fixes: 0178f4ce3c3b ("drm/i915/gvt: Enable vfio edid for all GVT supported platform") Reviewed-by: Hang Yuan <[email protected]> Signed-off-by: Zhenyu Wang <[email protected]> Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
2020-09-14drm/vboxvideo: Use drm_gem_vram_vmap() interfacesThomas Zimmermann2-58/+8
VRAM helpers support ref counting for pin and vmap operations, no need to avoid these operations by employing the internal kmap interface. Just use drm_gem_vram_vmap() and let it handle the details. Also unexport the kmap interfaces from VRAM helpers. Vboxvideo was the last user of these internal functions. v2: * fixed a comma in commit description Signed-off-by: Thomas Zimmermann <[email protected]> Reviewed-by: Daniel Vetter <[email protected]> Tested-by: Hans de Goede <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2020-09-13drm/mediatek: mtk_dpi: Convert to bridge driverEnric Balletbo i Serra1-29/+42
Convert mtk_dpi to a bridge driver with built-in encoder support for compatibility with existing component drivers. Signed-off-by: Enric Balletbo i Serra <[email protected]> Signed-off-by: Chun-Kuang Hu <[email protected]>
2020-09-13drm/mediatek: mtk_dpi: Rename bridge to next_bridgeEnric Balletbo i Serra1-4/+4
This is really a cosmetic change just to make a bit more readable the code after convert the driver to drm_bridge. The bridge variable name will be used by the encoder drm_bridge, and the chained bridge will be named next_bridge. Signed-off-by: Enric Balletbo i Serra <[email protected]> Signed-off-by: Chun-Kuang Hu <[email protected]>
2020-09-12drm/msm: Show process names in gem_describeRob Clark6-9/+34
In $debugfs/gem we already show any vma(s) associated with an object. Also show process names if the vma's address space is a per-process address space. Signed-off-by: Rob Clark <[email protected]> Reviewed-by: Jordan Crouse <[email protected]> Reviewed-by: Bjorn Andersson <[email protected]>
2020-09-12drm/msm/a6xx: Add support for per-instance pagetablesJordan Crouse3-0/+64
Add support for using per-instance pagetables if all the dependencies are available. Signed-off-by: Jordan Crouse <[email protected]> Signed-off-by: Rob Clark <[email protected]> Reviewed-by: Akhil P Oommen <[email protected]>
2020-09-12drm/msm: Add support for private address space instancesJordan Crouse5-6/+48
Add support for allocating private address space instances. Targets that support per-context pagetables should implement their own function to allocate private address spaces. The default will return a pointer to the global address space. Signed-off-by: Jordan Crouse <[email protected]> Signed-off-by: Rob Clark <[email protected]> Reviewed-by: Bjorn Andersson <[email protected]>
2020-09-12drm/msm: Add support to create a local pagetableJordan Crouse4-3/+215
Add support to create a io-pgtable for use by targets that support per-instance pagetables. In order to support per-instance pagetables the GPU SMMU device needs to have the qcom,adreno-smmu compatible string and split pagetables enabled. Signed-off-by: Jordan Crouse <[email protected]> Signed-off-by: Rob Clark <[email protected]> Reviewed-by: Bjorn Andersson <[email protected]>
2020-09-12drm/msm: Set the global virtual address range from the IOMMU domainJordan Crouse2-2/+18
Use the aperture settings from the IOMMU domain to set up the virtual address range for the GPU. This allows us to transparently deal with IOMMU side features (like split pagetables). Signed-off-by: Jordan Crouse <[email protected]> Signed-off-by: Rob Clark <[email protected]> Reviewed-by: Bjorn Andersson <[email protected]>
2020-09-12drm/msm: Drop context arg to gpu->submit()Jordan Crouse7-25/+17
Now that we can get the ctx from the submitqueue, the extra arg is redundant. Signed-off-by: Jordan Crouse <[email protected]> [split out of previous patch to reduce churny noise] Signed-off-by: Rob Clark <[email protected]> Reviewed-by: Bjorn Andersson <[email protected]>
2020-09-12drm/msm: Add a context pointer to the submitqueueJordan Crouse6-4/+30
Each submitqueue is attached to a context. Add a pointer to the context to the submitqueue at create time and refcount it so that it stays around through the life of the queue. Co-developed-by: Rob Clark <[email protected]> Signed-off-by: Jordan Crouse <[email protected]> Signed-off-by: Rob Clark <[email protected]> Reviewed-by: Bjorn Andersson <[email protected]>
2020-09-12drm/msm: Set adreno_smmu as gpu's drvdataRob Clark3-4/+6
This will be populated by adreno-smmu, to provide a way for coordinating enabling/disabling TTBR0 translation. Signed-off-by: Rob Clark <[email protected]> Reviewed-by: Jordan Crouse <[email protected]> Reviewed-by: Bjorn Andersson <[email protected]>
2020-09-12drm/msm/gpu: Add dev_to_gpu() helperRob Clark3-9/+12
In a later patch, the drvdata will not directly be 'struct msm_gpu *', so add a helper to reduce the churn. Signed-off-by: Rob Clark <[email protected]> Reviewed-by: Jordan Crouse <[email protected]> Reviewed-by: Bjorn Andersson <[email protected]>
2020-09-12drm/msm: Remove dangling submitqueue referencesRob Clark1-1/+3
Currently it doesn't matter, since we free the ctx immediately. But when we start refcnt'ing the ctx, we don't want old dangling list entries to hang around. Signed-off-by: Rob Clark <[email protected]> Reviewed-by: Jordan Crouse <[email protected]> Reviewed-by: Bjorn Andersson <[email protected]>
2020-09-12drm/msm/a6xx: fix a potential overflow issueZhenzhong Duan1-1/+1
It's allocating an array of a6xx_gpu_state_obj structure rathor than its pointers. This patch fix it. Signed-off-by: Zhenzhong Duan <[email protected]> Signed-off-by: Rob Clark <[email protected]>
2020-09-12drm/msm/adreno: fix probe without iommuLuca Weiss1-2/+8
The function iommu_domain_alloc returns NULL on platforms without IOMMU such as msm8974. This resulted in PTR_ERR(-ENODEV) being assigned to gpu->aspace so the correct code path wasn't taken. Fixes: ccac7ce373c1 ("drm/msm: Refactor address space initialization") Signed-off-by: Luca Weiss <[email protected]> Reviewed-by: Jordan Crouse <[email protected]> Signed-off-by: Rob Clark <[email protected]>
2020-09-12drm/msm/gpu: Add suspend/resume tracepointsRob Clark3-0/+32
Signed-off-by: Rob Clark <[email protected]>
2020-09-12drm/msm/dsi: add support for 7nm DSI PHY/PLLJonathan Marek10-0/+1714
This adds support for the 7nm ("V4") DSI PHY/PLL for sm8150 and sm8250. Implementation is based on 10nm driver, but updated based on the downstream 7nm driver. Signed-off-by: Jonathan Marek <[email protected]> Tested-by: Dmitry Baryshkov <[email protected]> (SM8250) Signed-off-by: Rob Clark <[email protected]>
2020-09-12drm/msm/dsi: add DSI config for sm8150 and sm8250Jonathan Marek2-1/+6
This allows DSI driver to work with sm8150 and sm8250. The sdm845 config is re-used as the config is the same. Signed-off-by: Jonathan Marek <[email protected]> Tested-by: Dmitry Baryshkov <[email protected]> (SM8250) Signed-off-by: Rob Clark <[email protected]>
2020-09-12drm/msm/dsi: remove unused clk_pre/clk_post in msm_dsi_dphy_timingJonathan Marek1-2/+0
The clk_pre/clk_post values in shared_timings are used instead, and these are unused. Signed-off-by: Jonathan Marek <[email protected]> Tested-by: Dmitry Baryshkov <[email protected]> (SM8250) Signed-off-by: Rob Clark <[email protected]>
2020-09-12drm/msm: Drop local dma_parmsRobin Murphy1-9/+1
Since commit 9495b7e92f71 ("driver core: platform: Initialize dma_parms for platform devices"), struct platform_device already provides a dma_parms structure, so we can save allocating another one. Also the DMA segment size is simply a size, not a bitmask. Signed-off-by: Robin Murphy <[email protected]> Signed-off-by: Rob Clark <[email protected]>
2020-09-12drm: xlnx: remove defined but not used 'scaling_factors_666'Jason Yan1-6/+0
This addresses the following gcc warning with "make W=1": drivers/gpu/drm/xlnx/zynqmp_disp.c:245:18: warning: ‘scaling_factors_666’ defined but not used [-Wunused-const-variable=] 245 | static const u32 scaling_factors_666[] = { | ^~~~~~~~~~~~~~~~~~~ Reported-by: Hulk Robot <[email protected]> Signed-off-by: Jason Yan <[email protected]> Signed-off-by: Hyun Kwon <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2020-09-11Merge drm/drm-next into drm-intel-next-queuedRodrigo Vivi893-10347/+26986
Sync drm-intel-gt-next here so we can have an unified fixes flow. Signed-off-by: Rodrigo Vivi <[email protected]>
2020-09-11drm/i915: Nuke dpio_phy_iosf_port[]Ville Syrjälä5-23/+14
There's no real reason to stash away the DPIO PHY IOSF sideband port numbers for VLV/CHV. Just compute them at runtime in the sideband code. Gets rid of the oddball intel_init_dpio() function from the high level init flow. Signed-off-by: Ville Syrjälä <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] Reviewed-by: Jani Nikula <[email protected]>
2020-09-11drm/bridge: dw-mipi-dsi: permit configuring the escape clock rateNeil Armstrong1-5/+20
The Amlogic D-PHY in the Amlogic AXG SoC Family does support a frequency higher than 10MHz for the TX Escape Clock, thus make the target rate configurable. Signed-off-by: Neil Armstrong <[email protected]> Reviewed-by: Philippe Cornu <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2020-09-11drm/bridge: dw-mipi-dsi: Use kmemdup cf. kmalloc+memcpyAlex Dewar1-3/+1
kmemdup can be used instead of kmalloc+memcpy. Replace an occurrence of this pattern. Issue identified with Coccinelle. Signed-off-by: Alex Dewar <[email protected]> Acked-by: Neil Armstrong <[email protected]> Signed-off-by: Neil Armstrong <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2020-09-11drm/ttm: nuke memory type flagsChristian König14-166/+148
It's not supported to specify more than one of those flags. So it never made sense to make this a flag in the first place. Nuke the flags and specify directly which memory type to use. Signed-off-by: Christian König <[email protected]> Reviewed-by: Dave Airlie <[email protected]> Link: https://patchwork.freedesktop.org/patch/389826/?series=81551&rev=1
2020-09-11drm/vmwgfx: stop setting multiple domain flagsChristian König1-2/+3
Setting more than one placement flag is illegal. Fix this by using the current flags. Signed-off-by: Christian König <[email protected]> Reviewed-by: Dave Airlie <[email protected]> Link: https://patchwork.freedesktop.org/patch/389824/?series=81551&rev=1
2020-09-11drm/nouveau: stop using TTM placement flagsChristian König16-97/+114
Those are going to be removed, stop using them here. Instead use the GEM flags from the UAPI. Signed-off-by: Christian König <[email protected]> Reviewed-by: Dave Airlie <[email protected]> Link: https://patchwork.freedesktop.org/patch/389825/?series=81551&rev=1
2020-09-11drm/vram-helper: stop using TTM placement flagsChristian König1-5/+9
Those are going to be removed, stop using them here. Instead define separate flags for the helper. Signed-off-by: Christian König <[email protected]> Reviewed-by: Dave Airlie <[email protected]> Link: https://patchwork.freedesktop.org/patch/389823/?series=81551&rev=1
2020-09-11drm/i915: move gmbus restore to i915_restore_displayJani Nikula1-2/+2
Logically part of the display restore. Note: This has been in place since the introduction of gmbus support. The gmbus code also does the resets before transfers. Is this really needed, or a historical accident? Cc: Ville Syrjälä <[email protected]> Reviewed-by: Ville Syrjälä <[email protected]> Signed-off-by: Jani Nikula <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2020-09-11drm/i915: move gen4 GCDGMBUS save/restore to display save/restoreJani Nikula1-9/+12
Logically part of the display save/restore. No functional changes. Reviewed-by: Ville Syrjälä <[email protected]> Signed-off-by: Jani Nikula <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2020-09-11drm/i915: disable all display features when no displayJani Nikula1-0/+8
Disable all display feature flags when there are no pipes i.e. there is no display. This should help with not having to additionally check for HAS_DISPLAY() when a feature flag check would suffice. Also disable modeset and atomic driver features. Cc: Ville Syrjälä <[email protected]> Reviewed-by: Ville Syrjälä <[email protected]> Signed-off-by: Jani Nikula <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2020-09-11drm/vc4: Fix bitwise OR versus ternary operator in vc4_plane_mode_setNathan Chancellor1-2/+2
Clang warns: drivers/gpu/drm/vc4/vc4_plane.c:901:27: warning: operator '?:' has lower precedence than '|'; '|' will be evaluated first [-Wbitwise-conditional-parentheses] fb->format->has_alpha ? ~~~~~~~~~~~~~~~~~~~~~ ^ drivers/gpu/drm/vc4/vc4_plane.c:901:27: note: place parentheses around the '|' expression to silence this warning fb->format->has_alpha ? ~~~~~~~~~~~~~~~~~~~~~ ^ drivers/gpu/drm/vc4/vc4_plane.c:901:27: note: place parentheses around the '?:' expression to evaluate it first fb->format->has_alpha ? ~~~~~~~~~~~~~~~~~~~~~~^ 1 warning generated. Add the parentheses as that was clearly intended, otherwise SCALER5_CTL2_ALPHA_PREMULT won't be added to the list. Fixes: c54619b0bfb3 ("drm/vc4: Add support for the BCM2711 HVS5") Signed-off-by: Nathan Chancellor <[email protected]> Link: https://github.com/ClangBuiltLinux/linux/issues/1150 Signed-off-by: Maxime Ripard <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2020-09-11drm/vc4: Update type of reg parameter in vc4_hdmi_{read,write}Nathan Chancellor1-2/+2
Clang warns 100+ times in the vc4 driver along the lines of: drivers/gpu/drm/vc4/vc4_hdmi_phy.c:518:13: warning: implicit conversion from enumeration type 'enum vc4_hdmi_field' to different enumeration type 'enum vc4_hdmi_regs' [-Wenum-conversion] HDMI_WRITE(HDMI_TX_PHY_POWERDOWN_CTL, ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~ The HDMI_READ and HDMI_WRITE macros pass in enumerators of type vc4_hdmi_field but vc4_hdmi_write and vc4_hdmi_read expect a enumerator of type vc4_hdmi_regs, causing a warning for every instance of this. Update the parameter type so there is no more mismatch. Fixes: 311e305fdb4e ("drm/vc4: hdmi: Implement a register layout abstraction") Signed-off-by: Nathan Chancellor <[email protected]> Link: https://github.com/ClangBuiltLinux/linux/issues/1149 Signed-off-by: Maxime Ripard <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2020-09-11drm/i810: make i810_flush_queue() return voidJason Yan1-3/+3
This function always return '0' and no callers use the return value. So make it a void function. This eliminates the following coccicheck warning: drivers/gpu/drm/i810/i810_dma.c:860:8-11: Unneeded variable: "ret". Return "0" on line 885 Reported-by: Hulk Robot <[email protected]> Signed-off-by: Jason Yan <[email protected]> Signed-off-by: Daniel Vetter <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2020-09-11drm/xlnx: Use devm_drm_dev_allocDaniel Vetter1-21/+6
Gets rid of drmm_add_final_kfree, which I want to unexport so that it stops confusion people about this transitional state of rolling drm managed memory out. This also fixes the missing drm_dev_put in the error path of the probe code. v2: Drop the misplaced drm_dev_put from zynqmp_dpsub_drm_init (all other paths leaked on error, this should have been in zynqmp_dpsub_probe), now that subsumed by the auto-cleanup of devm_drm_dev_alloc. Reviewed-by: Hyun Kwon <[email protected]> Signed-off-by: Daniel Vetter <[email protected]> Cc: Hyun Kwon <[email protected]> Cc: Laurent Pinchart <[email protected]> Cc: Michal Simek <[email protected]> Cc: [email protected] Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2020-09-11drm/vkms: Use devm_drm_dev_allocDaniel Vetter1-28/+28
This means we also need to slightly restructure the exit code, so that final cleanup of the drm_device is triggered by unregistering the platform device. Note that devres is both clean up when the driver is unbound (not the case for vkms, we don't bind), and also when unregistering the device (very much the case for vkms). Therefore we can rely on devres even though vkms isn't a proper platform device driver. This also somewhat untangles the load code, since the drm and platform device setup are no longer interleaved, but two distinct steps. v2: use devres_open/release_group so we can use devm without real hacks in the driver core or having to create an entire fake bus for testing drivers. Might want to extract this into helpers eventually, maybe as a mock_drm_dev_alloc or test_drm_dev_alloc. v3: Only deref vkms_device after checking it (Melissa) Reviewed-by: Melissa Wen <[email protected]> Cc: Melissa Wen <[email protected]> Signed-off-by: Daniel Vetter <[email protected]> Cc: Rodrigo Siqueira <[email protected]> Cc: Haneen Mohammed <[email protected]> Cc: Daniel Vetter <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2020-09-11drm/vgem: Use devm_drm_dev_allocDaniel Vetter1-31/+24
This means we also need to slightly restructure the exit code, so that final cleanup of the drm_device is triggered by unregistering the platform device. Note that devres is both clean up when the driver is unbound (not the case for vgem, we don't bind), and also when unregistering the device (very much the case for vgem). Therefore we can rely on devres even though vgem isn't a proper platform device driver. This also somewhat untangles the load code, since the drm and platform device setup are no longer interleaved, but two distinct steps. v2: use devres_open/release_group so we can use devm without real hacks in the driver core or having to create an entire fake bus for testing drivers. Might want to extract this into helpers eventually, maybe as a mock_drm_dev_alloc or test_drm_dev_alloc. v3: Fix error code handling (Melissa) Cc: Melissa Wen <[email protected]> Reviewed-by: Melissa Wen <[email protected]> Signed-off-by: Daniel Vetter <[email protected]> Cc: Daniel Vetter <[email protected]> Cc: Emil Velikov <[email protected]> Cc: Sean Paul <[email protected]> Cc: Chris Wilson <[email protected]> Cc: Sam Ravnborg <[email protected]> Cc: Rob Clark <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2020-09-11drm/aspeed: Use managed drmm_mode_config_cleanupDaniel Vetter1-4/+11
Since aspeed doesn't use devm_kzalloc anymore we can use the managed mode config cleanup. v2: Keep call order as suggested by Sam. Acked-by: Sam Ravnborg <[email protected]> Signed-off-by: Daniel Vetter <[email protected]> Cc: Joel Stanley <[email protected]> Cc: Andrew Jeffery <[email protected]> Cc: [email protected] Cc: [email protected] Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2020-09-11drm/armada: Don't use drm_device->dev_privateDaniel Vetter7-14/+14
Upcasting using a container_of macro is more typesafe, faster and easier for the compiler to optimize. Signed-off-by: Daniel Vetter <[email protected]> Reviewed-by: Dave Airlie <[email protected]> Cc: Russell King <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2020-09-11drm/armada: Use devm_drm_dev_allocDaniel Vetter1-20/+6
Also remove the now no longer needed build bug on since that's already not needed anymore with drmm_add_final_kfree. Conversion to managed drm_device cleanup is easy, the final drm_dev_put() is already the last thing in both the bind unbind as in the unbind flow. Also, this relies on component.c correctly wrapping bind&unbind in separate devres groups, which it does. Signed-off-by: Daniel Vetter <[email protected]> Reviewed-by: Dave Airlie <[email protected]> Cc: Russell King <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2020-09-11Merge tag 'drm-misc-fixes-2020-09-09' of ↵Dave Airlie10-25/+66
git://anongit.freedesktop.org/drm/drm-misc into drm-fixes drm-misc-fixes for v5.9-rc5: - Fix double free in virtio. - Add missing put_device in sun4i, and other fixes. - Small ingenic fixes. - Handle sun4i alpha on lowest plane correctly. - Remove output->enabled from virtio, as it should use crtc_state. - Fix tve200 enable/disable. - Documentation fix. - Fix virtio unblank. Signed-off-by: Dave Airlie <[email protected]> From: Maarten Lankhorst <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2020-09-11Merge tag 'drm-intel-fixes-2020-09-10' of ↵Dave Airlie1-6/+4
git://anongit.freedesktop.org/drm/drm-intel into drm-fixes drm/i915 fixes for v5.9-rc5: - Fix regression leading to audio probe failure Signed-off-by: Dave Airlie <[email protected]> From: Jani Nikula <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2020-09-10objtool: Rename frame.h -> objtool.hJulien Thierry1-2/+1
Header frame.h is getting more code annotations to help objtool analyze object files. Rename the file to objtool.h. [ jpoimboe: add objtool.h to MAINTAINERS ] Signed-off-by: Julien Thierry <[email protected]> Signed-off-by: Josh Poimboeuf <[email protected]>