aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/udl/udl_main.c
Commit message (Collapse)AuthorAgeFilesLines
* drm/udl: Set error code in udl_init()Dan Carpenter2025-04-171-0/+1
| | | | | | | | | | Return -ENOMEM if udl_alloc_urb_list() fails. Don't return success. Fixes: fb10144ba426 ("drm/udl: Support adapters without firmware descriptor") Signed-off-by: Dan Carpenter <[email protected]> Reviewed-by: Thomas Zimmermann <[email protected]> Signed-off-by: Thomas Zimmermann <[email protected]> Link: https://lore.kernel.org/r/[email protected]
* drm/udl: Support adapters without firmware descriptorThomas Zimmermann2025-04-141-16/+21
| | | | | | | | | | | | | | | | | Set default limit on the number of pixels for adapters without vendor firmware descriptor. The devices work as expected, they just don't provide any description. If parsing the vendor firmware descriptor fails, the device falls back to the given default limits. Failing to allocate memory is still an error. v2: - fix typo in constant (Patrik) Signed-off-by: Thomas Zimmermann <[email protected]> Reviewed-by: Patrik Jakobsson <[email protected]> Link: https://lore.kernel.org/r/[email protected]
* drm/udl: Validate length in vendor-descriptor parserThomas Zimmermann2025-04-141-26/+51
| | | | | | | | | | | | | | | | | | | | | | | | | Rewrite the parser for the vendor firmware descriptor with the following improvements. - Validate the key-value length given in a vendor descriptor against the length of the descriptor. The current code fails to do this and might read more bytes than available. This can lead to out-of-bounds reads of the allocated buffer. - Read raw data with helpers for unaligned data. This allows the code to run on platforms that do now support unaligned memory access by default. - Validate the pixel limit against a default value. The default comes from real-world devices. If the reported number of pixels is significantly above the limit, it is likely invalid. - Drop the obsolete print macros. There is still a warning about invalid firmware descriptors. The rest of the output is bogus. Signed-off-by: Thomas Zimmermann <[email protected]> Reviewed-by: Patrik Jakobsson <[email protected]> Link: https://lore.kernel.org/r/[email protected]
* drm/udl: Treat vendor descriptor as u8Thomas Zimmermann2025-04-141-8/+8
| | | | | | | | | The vendor descriptor is an array of unsigned bytes. It is raw data that is not to be modified. Declare it as 'const u8'. Signed-off-by: Thomas Zimmermann <[email protected]> Reviewed-by: Patrik Jakobsson <[email protected]> Link: https://lore.kernel.org/r/[email protected]
* drm/udl: Return error if vendor descriptor is too shortThomas Zimmermann2025-04-141-31/+31
| | | | | | | | | | | | | | | | | | There need to be least 5 bytes in the vendor descriptor. Return an error otherwise. Also change the branching to early-out on the error. Adjust indention of the rest of the parser function. The original length test expected more than 5 bytes in the vendor descriptor. As a descriptor with no key-value pairs has exactly 5 bytes and is still valid, change the test to accept this case as well. v2 - clarify changes to length test in commit description (Patrik) Signed-off-by: Thomas Zimmermann <[email protected]> Reviewed-by: Patrik Jakobsson <[email protected]> Link: https://lore.kernel.org/r/[email protected]
* drm/udl: Handle errors from usb_get_descriptor()Thomas Zimmermann2025-04-141-10/+14
| | | | | | | | | | | Reading the vendor descriptor from the udl device can fail with an error, which the current code fails to capture. Store the return value in an integer and test for the error. Abort parsing on errors or treat the value as length on success. Signed-off-by: Thomas Zimmermann <[email protected]> Reviewed-by: Patrik Jakobsson <[email protected]> Link: https://lore.kernel.org/r/[email protected]
* drm/udl: Improve type safety when using struct udl_deviceThomas Zimmermann2025-04-141-16/+12
| | | | | | | | | | Push upcasts from struct drm_device to struct udl_device outwards in the call chain; cast earlier and call functions with the upcasted value. Improves type safety. Signed-off-by: Thomas Zimmermann <[email protected]> Reviewed-by: Patrik Jakobsson <[email protected]> Link: https://lore.kernel.org/r/[email protected]
* drm/udl: Remove unused field gem_lock from struct udl_deviceThomas Zimmermann2025-04-141-2/+0
| | | | | | | | | Reduce the size of struct udl_device by removing the unused field gem_lock. Signed-off-by: Thomas Zimmermann <[email protected]> Reviewed-by: Patrik Jakobsson <[email protected]> Link: https://lore.kernel.org/r/[email protected]
* drm/udl: Switch poll helpers to managed cleanupThomas Zimmermann2025-03-241-2/+0
| | | | | | | | | Call drmm_kms_helper_poll_init() to set up managed cleanup for connector polling. Signed-off-by: Thomas Zimmermann <[email protected]> Reviewed-by: Patrik Jakobsson <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
* drm/udl: Set struct drm_device.dma_devThomas Zimmermann2025-03-121-7/+7
| | | | | | | | | Set the dma_dev field provided by the DRM device. Required for PRIME dma-buf import. Remove the driver's implementation. Signed-off-by: Thomas Zimmermann <[email protected]> Reviewed-by: Jani Nikula <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
* drm/udl: delete dead codeDan Carpenter2023-05-031-1/+1
| | | | | | | | | | | | | | | | | | | The "unode" pointer cannot be NULL here and checking for it causes Smatch warnings: drivers/gpu/drm/udl/udl_main.c:259 udl_get_urb_locked() warn: can 'unode' even be NULL? Fortunately, it's just harmless dead code which can be removed. It's left over from commit c5c354a3a472 ("drm/udl: Fix inconsistent urbs.count value during udl_free_urb_list()"). Reported-by: kernel test robot <[email protected]> Signed-off-by: Dan Carpenter <[email protected]> Reviewed-by: Thomas Zimmermann <[email protected]> Reviewed-by: Takashi Iwai <[email protected]> Signed-off-by: Thomas Zimmermann <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
* drm/udl: Sync pending URBs at the end of suspendTakashi Iwai2022-09-101-4/+2
| | | | | | | | | | | | | | | It's better to perform the sync at the very last of the suspend instead of the pipe-disable function, so that we can catch all pending URBs (if any). While we're at it, drop the error code from udl_sync_pending_urb() since we basically ignore it; instead, give a clear error message indicating a problem. Acked-by: Thomas Zimmermann <[email protected]> Signed-off-by: Takashi Iwai <[email protected]> Signed-off-by: Thomas Zimmermann <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
* drm/udl: Don't re-initialize stuff at retrying the URB list allocationTakashi Iwai2022-09-101-4/+3
| | | | | | | | | | | | udl_alloc_urb_list() retires the allocation if there is no enough room left, and it reinitializes the stuff unnecessarily such as the linked list head and the waitqueue, which could be harmful. Those should be outside the retry loop. Acked-by: Thomas Zimmermann <[email protected]> Signed-off-by: Takashi Iwai <[email protected]> Signed-off-by: Thomas Zimmermann <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
* drm/udl: Fix inconsistent urbs.count value during udl_free_urb_list()Takashi Iwai2022-09-101-13/+29
| | | | | | | | | | | | | | | | | | | | In the current design, udl_get_urb() may be called asynchronously during the driver freeing its URL list via udl_free_urb_list(). The problem is that the sync is determined by comparing the urbs.count and urbs.available fields, while we clear urbs.count field only once after udl_free_urb_list() finishes, i.e. during udl_free_urb_list(), the state becomes inconsistent. For fixing this inconsistency and also for hardening the locking scheme, this patch does a slight refactoring of the code around udl_get_urb() and udl_free_urb_list(). Now urbs.count is updated in the same spinlock at extracting a URB from the list in udl_free_url_list(). Acked-by: Thomas Zimmermann <[email protected]> Signed-off-by: Takashi Iwai <[email protected]> Signed-off-by: Thomas Zimmermann <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
* drm/udl: Fix potential URB leaksTakashi Iwai2022-09-101-3/+5
| | | | | | | | | | | | A couple of error handlings forgot to process the URB completion. Those are both with WARN_ON() so should be visible, but we must fix them in anyway. Fixes: 7350b2a3fbc6 ("drm/udl: Replace BUG_ON() with WARN_ON()") Acked-by: Thomas Zimmermann <[email protected]> Signed-off-by: Takashi Iwai <[email protected]> Signed-off-by: Thomas Zimmermann <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
* drm/udl: Increase the default URB list size to 20Takashi Iwai2022-09-101-1/+1
| | | | | | | | | | | It seems that the current size (4) for the URB list is too small on some devices, and it resulted in the occasional stalls. Increase the default URB list size to 20 for working around it. Acked-by: Thomas Zimmermann <[email protected]> Signed-off-by: Takashi Iwai <[email protected]> Signed-off-by: Thomas Zimmermann <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
* drm/udl: Suppress error print for -EPROTO at URB completionTakashi Iwai2022-09-101-0/+1
| | | | | | | | | | | The driver may receive -EPROTO at the URB completion when the device gets disconnected, and it's a normal situation. Suppress the error print for that, too. Signed-off-by: Takashi Iwai <[email protected]> Acked-by: Thomas Zimmermann <[email protected]> Signed-off-by: Thomas Zimmermann <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
* Revert "drm/udl: Kill pending URBs at suspend and disconnect"Takashi Iwai2022-09-101-22/+3
| | | | | | | | | | | | This reverts the recent fix commit e25d5954264d ("drm/udl: Kill pending URBs at suspend and disconnect") as it turned out to lead to potential hangup at a disconnection, and it doesn't help much for suspend/resume problem, either. Acked-by: Thomas Zimmermann <[email protected]> Signed-off-by: Takashi Iwai <[email protected]> Signed-off-by: Thomas Zimmermann <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
* drm/udl: Add reset_resumeThomas Zimmermann2022-09-101-1/+1
| | | | | | | | | | Implement the reset_resume callback of struct usb_driver. Set the standard channel when called. Signed-off-by: Thomas Zimmermann <[email protected]> Reviewed-by: Daniel Vetter <[email protected]> Signed-off-by: Takashi Iwai <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
* drm/udl: Replace BUG_ON() with WARN_ON()Takashi Iwai2022-08-101-1/+2
| | | | | | | | | | | | BUG_ON() is a tasteless choice as a sanity check for a driver like UDL that isn't really a core code. Replace with WARN_ON() and proper error handling instead. Tested-by: Thomas Zimmermann <[email protected]> Signed-off-by: Takashi Iwai <[email protected]> Signed-off-by: Thomas Zimmermann <[email protected]> Reviewed-by: Thomas Zimmermann <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
* drm/udl: Kill pending URBs at suspend and disconnectTakashi Iwai2022-08-101-3/+22
| | | | | | | | | | | | | | At both suspend and disconnect, we should rather cancel the pending URBs immediately. For the suspend case, the display will be turned off, so it makes no sense to process the rendering. And for the disconnect case, the device may be no longer accessible, hence we shouldn't do any submission. Tested-by: Thomas Zimmermann <[email protected]> Signed-off-by: Takashi Iwai <[email protected]> Signed-off-by: Thomas Zimmermann <[email protected]> Reviewed-by: Thomas Zimmermann <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
* drm/udl: Sync pending URBs at suspend / disconnectTakashi Iwai2022-08-101-0/+17
| | | | | | | | | | | | We need to wait for finishing to process the all URBs after disabling the pipe; otherwise pending URBs may stray at suspend/resume, leading to a possible memory corruption in a worst case. Tested-by: Thomas Zimmermann <[email protected]> Signed-off-by: Takashi Iwai <[email protected]> Signed-off-by: Thomas Zimmermann <[email protected]> Reviewed-by: Thomas Zimmermann <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
* drm/udl: Replace semaphore with a simple wait queueTakashi Iwai2022-08-101-61/+23
| | | | | | | | | | | | | | | | UDL driver uses a semaphore for controlling the emptiness of FIFO in a slightly funky way. This patch replaces it with a wait queue and controls the emptiness with the standard wait_event*() macro instead, which is a more straightforward implementation. While we are at it, drop the dead code for delayed semaphore down, too. Tested-by: Thomas Zimmermann <[email protected]> Signed-off-by: Takashi Iwai <[email protected]> Signed-off-by: Thomas Zimmermann <[email protected]> Reviewed-by: Thomas Zimmermann <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
* drm: Use USB controller's DMA mask when importing dmabufsThomas Zimmermann2021-03-111-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | USB devices cannot perform DMA and hence have no dma_mask set in their device structure. Therefore importing dmabuf into a USB-based driver fails, which breaks joining and mirroring of display in X11. For USB devices, pick the associated USB controller as attachment device. This allows the DRM import helpers to perform the DMA setup. If the DMA controller does not support DMA transfers, we're out of luck and cannot import. Our current USB-based DRM drivers don't use DMA, so the actual DMA device is not important. Tested by joining/mirroring displays of udl and radeon under Gnome/X11. v8: * release dmadev if device initialization fails (Noralf) * fix commit description (Noralf) v7: * fix use-before-init bug in gm12u320 (Dan) v6: * implement workaround in DRM drivers and hold reference to DMA device while USB device is in use * remove dev_is_usb() (Greg) * collapse USB helper into usb_intf_get_dma_device() (Alan) * integrate Daniel's TODO statement (Daniel) * fix typos (Greg) v5: * provide a helper for USB interfaces (Alan) * add FIXME item to documentation and TODO list (Daniel) v4: * implement workaround with USB helper functions (Greg) * use struct usb_device->bus->sysdev as DMA device (Takashi) v3: * drop gem_create_object * use DMA mask of USB controller, if any (Daniel, Christian, Noralf) v2: * move fix to importer side (Christian, Daniel) * update SHMEM and CMA helpers for new PRIME callbacks Signed-off-by: Thomas Zimmermann <[email protected]> Fixes: 6eb0233ec2d0 ("usb: don't inherity DMA properties for USB devices") Tested-by: Pavel Machek <[email protected]> Reviewed-by: Greg Kroah-Hartman <[email protected]> Acked-by: Christian König <[email protected]> Acked-by: Daniel Vetter <[email protected]> Acked-by: Noralf Trønnes <[email protected]> Cc: Christoph Hellwig <[email protected]> Cc: Greg Kroah-Hartman <[email protected]> Cc: <[email protected]> # v5.10+ Signed-off-by: Thomas Zimmermann <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] Signed-off-by: Maarten Lankhorst <[email protected]>
* drm/udl: Retrieve USB device from struct drm_device.devThomas Zimmermann2020-11-091-11/+12
| | | | | | | | | | | | | | | Drop the driver's udev field in favor of struct drm_device.dev. No functional changes made. v3: * upcast dev with udl_to_usb_device() v2: * upcast dev with drm_dev_get_usb_device() Signed-off-by: Thomas Zimmermann <[email protected]> Reviewed-by: Hans de Goede <[email protected]> Acked-by: Daniel Vetter <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
* drm/udl: drop drm_driver.release hookDaniel Vetter2020-03-261-10/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There's only two functions called from that: drm_kms_helper_poll_fini() and udl_free_urb_list(). Both of these are also called from the ubs_driver->disconnect hook, so entirely pointless to do the same again in the ->release hook. Furthermore by the time we clean up the drm_driver we really shouldn't be touching hardware anymore, so stopping the poll worker and freeing the urb allocations in ->disconnect is the right thing to do. Now disconnect still cleans things up before unregistering the driver, but that's a different issue. v2: Use _fini, not _disable in unplug, motivated by discussions with Thomas. _disable/_enable are for suspend/resume. Acked-by: Thomas Zimmermann <[email protected]> Signed-off-by: Daniel Vetter <[email protected]> Cc: Dave Airlie <[email protected]> Cc: Sean Paul <[email protected]> Cc: Daniel Vetter <[email protected]> Cc: Thomas Zimmermann <[email protected]> Cc: Emil Velikov <[email protected]> Cc: Gerd Hoffmann <[email protected]> Cc: "Noralf Trønnes" <[email protected]> Cc: Sam Ravnborg <[email protected]> Cc: Thomas Gleixner <[email protected]> Cc: Alex Deucher <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
* drm/udl: Remove struct udl_device.active_fb_16Thomas Zimmermann2019-12-111-3/+0
| | | | | | | | | | | | | | The udl driver stores the currently active framebuffer to know from where to accept damage updates. With the conversion to plane-state damage handling, this is not necessary any longer. The currently active framebuffer and damaged area are always stored in the plane state. Signed-off-by: Thomas Zimmermann <[email protected]> Reviewed-by: Daniel Vetter <[email protected]> Reviewed-by: Emil Velikov <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
* drm/udl: Remove field lost_pixels from struct udl_deviceThomas Zimmermann2019-12-061-3/+0
| | | | | | | | | | | | The field lost_pixels in struct udl_device was supposed to signal an error during USB transfers of the framebuffer data. The driver would have to schedule a re-transfer at a later point. This code was never implemented. Remove lost_pixels and return regular error codes instead. Signed-off-by: Thomas Zimmermann <[email protected]> Reviewed-by: Emil Velikov <[email protected]> Acked-by: Gerd Hoffmann <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
* drm/udl: Store active framebuffer in device structureThomas Zimmermann2019-11-261-0/+3
| | | | | | | | | | The framebuffer's 'active_16' flag signals which framebuffer to flush to device memory. Moving the 'active_16' state from struct udl_framebuffer into struct udl_device prepares for using the generic GEM framebuffer. Signed-off-by: Thomas Zimmermann <[email protected]> Acked-by: Sam Ravnborg <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
* drm/udl: Replace fbdev code with generic emulationThomas Zimmermann2019-11-191-6/+0
| | | | | | | | | | | | | | | | | | The udl driver can use the generic fbdev implementation. Convert it. v5: * initialize console after registering device v4: * hardcode console bpp to 16 v3: * remove module parameter fb_bpp in favor of fbdev's video * call drm_fbdev_generic_setup() directly; remove udl_fbdev_init() * use default for struct drm_mode_config_funcs.output_poll_changed * use default for struct drm_driver.lastclose Signed-off-by: Thomas Zimmermann <[email protected]> Reviewed-by: Noralf Trønnes <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
* drm/udl: drop use of drmP.hSam Ravnborg2019-07-171-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | The drmP.h header file is deprecated. Drop it from all files in the udl driver. Made the header files self contained, which then made it simpler to update the .c files. Signed-off-by: Sam Ravnborg <[email protected]> Acked-by: Emil Velikov <[email protected]> Reviewed-by: Alex Deucher <[email protected]> Cc: Sean Paul <[email protected]> Cc: David Airlie <[email protected]> Cc: Daniel Vetter <[email protected]> Cc: Jani Nikula <[email protected]> Cc: Robert Tarasov <[email protected]> Cc: Oleksandr Andrushchenko <[email protected]> Cc: Thomas Zimmermann <[email protected]> Cc: "Noralf Trønnes" <[email protected]> Cc: Eric Anholt <[email protected]> Cc: Mikulas Patocka <[email protected]> Cc: Emil Lundmark <[email protected]> Cc: Eugeniy Paltsev <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
* treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 262Thomas Gleixner2019-06-051-4/+1
| | | | | | | | | | | | | | | | | | | | | | Based on 1 normalized pattern(s): this file is subject to the terms and conditions of the gnu general public license v2 see the file copying in the main directory of this archive for more details extracted by the scancode license scanner the SPDX license identifier GPL-2.0-only has been chosen to replace the boilerplate/reference in 11 file(s). Signed-off-by: Thomas Gleixner <[email protected]> Reviewed-by: Alexios Zavras <[email protected]> Reviewed-by: Allison Randal <[email protected]> Reviewed-by: Richard Fontana <[email protected]> Cc: [email protected] Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
* drm/udl: move to embedding drm device inside udl device.Dave Airlie2019-04-241-20/+3
| | | | | | | | | This should help with some of the lifetime issues, and move us away from load/unload. Acked-by: Alex Deucher <[email protected]> Signed-off-by: Dave Airlie <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
* drm/udl: introduce a macro to convert dev to udl.Dave Airlie2019-04-241-6/+6
| | | | | | | | This just makes it easier to later embed drm into udl. Reviewed-by: Alex Deucher <[email protected]> Signed-off-by: Dave Airlie <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
* drm/udl: add a release method and delay modeset teardownDave Airlie2019-04-081-1/+7
| | | | | | | | | | | | | | | If we unplug a udl device, the usb callback with deinit the mode_config struct, however userspace will still have an open file descriptor and a framebuffer on that device. When userspace closes the fd, we'll oops because it'll try and look stuff up in the object idr which we've destroyed. This punts destroying the mode objects until release time instead. Cc: [email protected] Reviewed-by: Daniel Vetter <[email protected]> Signed-off-by: Dave Airlie <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
* drm: Split out drm_probe_helper.hDaniel Vetter2019-01-241-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Having the probe helper stuff (which pretty much everyone needs) in the drm_crtc_helper.h file (which atomic drivers should never need) is confusing. Split them out. To make sure I actually achieved the goal here I went through all drivers. And indeed, all atomic drivers are now free of drm_crtc_helper.h includes. v2: Make it compile. There was so much compile fail on arm drivers that I figured I'll better not include any of the acks on v1. v3: Massive rebase because i915 has lost a lot of drmP.h includes, but not all: Through drm_crtc_helper.h > drm_modeset_helper.h -> drmP.h there was still one, which this patch largely removes. Which means rolling out lots more includes all over. This will also conflict with ongoing drmP.h cleanup by others I expect. v3: Rebase on top of atomic bochs. v4: Review from Laurent for bridge/rcar/omap/shmob/core bits: - (re)move some of the added includes, use the better include files in other places (all suggested from Laurent adopted unchanged). - sort alphabetically v5: Actually try to sort them, and while at it, sort all the ones I touch. v6: Rebase onto i915 changes. v7: Rebase once more. Acked-by: Harry Wentland <[email protected]> Acked-by: Sam Ravnborg <[email protected]> Cc: Sam Ravnborg <[email protected]> Cc: Jani Nikula <[email protected]> Cc: Laurent Pinchart <[email protected]> Acked-by: Rodrigo Vivi <[email protected]> Acked-by: Benjamin Gaignard <[email protected]> Acked-by: Jani Nikula <[email protected]> Acked-by: Neil Armstrong <[email protected]> Acked-by: Oleksandr Andrushchenko <[email protected]> Acked-by: CK Hu <[email protected]> Acked-by: Alex Deucher <[email protected]> Acked-by: Sam Ravnborg <[email protected]> Reviewed-by: Laurent Pinchart <[email protected]> Acked-by: Liviu Dudau <[email protected]> Signed-off-by: Daniel Vetter <[email protected]> Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
* DRM: UDL: get rid of useless vblank initializationEugeniy Paltsev2018-10-231-6/+1
| | | | | | | | | | | | | | | | UDL doesn't support vblank functionality so we don't need to initialize vblank here (we are able to send page flip completion events even without vblank initialization) Moreover current drm_vblank_init call with num_crtcs > 0 causes sending DRM_EVENT_FLIP_COMPLETE event with zero timestamp every time. This breaks userspace apps (for example weston) which relies on timestamp value. Cc: [email protected] Signed-off-by: Eugeniy Paltsev <[email protected]> Signed-off-by: Daniel Vetter <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
* udl-kms: use spin_lock_irq instead of spin_lock_irqsaveMikulas Patocka2018-07-301-6/+4
| | | | | | | | | | | spin_lock_irqsave and spin_unlock_irqrestore is inteded to be called from a context where it is unknown if interrupts are enabled or disabled (such as interrupt handlers). From a process context, we should call spin_lock_irq and spin_unlock_irq, that avoids the costly pushf and popf instructions. Signed-off-by: Mikulas Patocka <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* udl-kms: handle allocation failureMikulas Patocka2018-07-301-10/+18
| | | | | | | | | | Allocations larger than PAGE_ALLOC_COSTLY_ORDER are unreliable and they may fail anytime. This patch fixes the udl kms driver so that when a large alloactions fails, it tries to do multiple smaller allocations. Signed-off-by: Mikulas Patocka <[email protected]> Cc: [email protected] Signed-off-by: Dave Airlie <[email protected]>
* udl-kms: change down_interruptible to downMikulas Patocka2018-07-301-6/+1
| | | | | | | | | | If we leave urbs around, it causes not only leak, but also memory corruption. This patch fixes the function udl_free_urb_list, so that it always waits for all urbs that are in progress. Signed-off-by: Mikulas Patocka <[email protected]> Cc: [email protected] Signed-off-by: Dave Airlie <[email protected]>
* drm/udl: Get rid of dev->struct_mutex usageDaniel Vetter2018-03-281-0/+2
| | | | | | | | | | | | | | | | | | It's only used to protect our page list, and only when we know we have a full reference. This means none of these code paths can ever race with the final unref, and hence we do not need dev->struct_mutex serialization and can simply switch to our own locking. For more context the only magic the locked gem_free_object provides is that it prevents concurrent final unref (and destruction) of gem objects while anyone is holding dev->struct_mutex. This was used by i915 (and other drivers) to implement eviction handling with less headaches. Signed-off-by: Daniel Vetter <[email protected]> Cc: Dave Airlie <[email protected]> Reviewed-by: Sean Paul <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
* drm/udl: Fixed problem with UDL adpater reconnectionRobert Tarasov2017-10-161-0/+5
| | | | | | | | | | | | Fixed problem with DisplayLink and DisplayLink certified adapers in drm/udl driver when adapter doesn't want to work if it was initialized with disconnected DVI cable by enabling drm connectot polling and updating current connector's state. Signed-off-by: Robert Tarasov <[email protected]> Reviewed-by: Alex Deucher <[email protected]> Signed-off-by: Alex Deucher <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
* drm/udl: Drop drm_vblank_cleanupDaniel Vetter2017-06-261-2/+0
| | | | | | | | | | udl doesn't shut down the display, so stopping the vblank isn't going to do much good either. Just drop it. Cc: Dave Airlie <[email protected]> Reviewed-by: Sean Paul <[email protected]> Signed-off-by: Daniel Vetter <[email protected]> Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
* drm: Change the return type of the unload hook to voidGabriel Krisman Bertazi2017-01-091-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The integer returned by the unload hook is ignored by the drm core, so let's make it void. This patch was created using the following Coccinelle semantic script (except for the declaration and comment in drm_drv.h): Compile-tested only. // <smpl> @ get_name @ struct drm_driver drv; identifier fn; @@ drv.unload = fn; @ replace_type @ identifier get_name.fn; @@ - int + void fn (...) { ... } @ remove_return_param @ identifier get_name.fn; @@ void fn (...) { <... if (...) return - ... ; ...> } @ drop_final_return @ identifier get_name.fn; @@ void fn (...) { ... - return 0; } // </smpl> Suggested-by: Daniel Vetter <[email protected]> Signed-off-by: Gabriel Krisman Bertazi <[email protected]> Acked-by: Christian König <[email protected]>. Signed-off-by: Daniel Vetter <[email protected]> Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
* drm/udl: make control msg static const. (v2)Dave Airlie2016-11-101-5/+11
| | | | | | | | | | | | Thou shall not send control msg from the stack, does that mean I can send it from the RO memory area? and it looks like the answer is no, so here's v2 which kmemdups. Reported-by: poma Tested-by: poma <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* drm/udl: Ensure channel is selected before using the device.Jamie Lentin2016-08-231-0/+25
| | | | | | | | | Lift configuration command from udlfb. This appears to be essential for at least a Rextron VCUD-60, without which no URB communication occurs. Signed-off-by: Jamie Lentin <[email protected]> Signed-off-by: Daniel Vetter <[email protected]> Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
* drm: merge drm_usb into udlDavid Herrmann2014-09-101-3/+5
| | | | | | | | | | This merges all the remains of drm_usb into its only user, udl. We can then drop all the drm_usb stuff, including dev->usbdev. Signed-off-by: David Herrmann <[email protected]> Reviewed-by: Thierry Reding <[email protected]> Reviewed-by: Daniel Vetter <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* drm/udl: add vblank supportStéphane Marchesin2014-07-081-0/+15
| | | | | | | | This is needed to be able to send page flip completion events. Also while I'm at it, fix the error paths on init. Signed-off-by: Stéphane Marchesin <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* Merge branch 'drm-next' of git://people.freedesktop.org/~airlied/linuxLinus Torvalds2014-06-121-0/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Pull drm updates from Dave Airlie: "This is the main drm merge window pull request, changes all over the place, mostly normal levels of churn. Highlights: Core drm: More cleanups, fix race on connector/encoder naming, docs updates, object locking rework in prep for atomic modeset i915: mipi DSI support, valleyview power fixes, cursor size fixes, execlist refactoring, vblank improvements, userptr support, OOM handling improvements radeon: GPUVM tuning and large page size support, gart fixes, deep color HDMI support, HDMI audio cleanups nouveau: - displayport rework should fix lots of issues - initial gk20a support - gk110b support - gk208 fixes exynos: probe order fixes, HDMI changes, IPP consolidation msm: debugfs updates, misc fixes ast: ast2400 support, sync with UMS driver tegra: cleanups, hdmi + hw cursor for Tegra 124. panel: fixes existing panels add some new ones. ipuv3: moved from staging to drivers/gpu" * 'drm-next' of git://people.freedesktop.org/~airlied/linux: (761 commits) drm/nouveau/disp/dp: fix tmds passthrough on dp connector drm/nouveau/dp: probe dpcd to determine connectedness drm/nv50-: trigger update after all connectors disabled drm/nv50-: prepare for attaching a SOR to multiple heads drm/gf119-/disp: fix debug output on update failure drm/nouveau/disp/dp: make use of postcursor when its available drm/g94-/disp/dp: take max pullup value across all lanes drm/nouveau/bios/dp: parse lane postcursor data drm/nouveau/dp: fix support for dpms drm/nouveau: register a drm_dp_aux channel for each dp connector drm/g94-/disp: add method to power-off dp lanes drm/nouveau/disp/dp: maintain link in response to hpd signal drm/g94-/disp: bash and wait for something after changing lane power regs drm/nouveau/disp/dp: split link config/power into two steps drm/nv50/disp: train PIOR-attached DP from second supervisor drm/nouveau/disp/dp: make use of existing output data for link training drm/gf119/disp: start removing direct vbios parsing from supervisor drm/nv50/disp: start removing direct vbios parsing from supervisor drm/nouveau/disp/dp: maintain receiver caps in response to hpd signal drm/nouveau/disp/dp: create subclass for dp outputs ...
| * drm/udl: Initialize ret in udl_driver_loadDaniel Vetter2014-04-221-0/+1
| | | | | | | | | | | | | | | | | | | | We need to set it to -ENODEV when we don't recognize the device. Otherwise we return/print stack garbage. Spotted by coverity. Reviewed-by: David Herrmann <[email protected]> Signed-off-by: Daniel Vetter <[email protected]>