Thomas Zimmermann
0b4346d689
drm/udl: Improve type safety when using struct udl_device
...
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 <tzimmermann@suse.de >
Reviewed-by: Patrik Jakobsson <patrik.r.jakobsson@gmail.com >
Link: https://lore.kernel.org/r/20250410105948.25463-4-tzimmermann@suse.de
2025-04-14 10:19:18 +02:00
Thomas Zimmermann
695a7f1c11
drm/udl: Switch poll helpers to managed cleanup
...
Call drmm_kms_helper_poll_init() to set up managed cleanup for
connector polling.
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de >
Reviewed-by: Patrik Jakobsson <patrik.r.jakobsson@gmail.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20250303145604.62962-3-tzimmermann@suse.de
2025-03-24 09:31:02 +01:00
Thomas Zimmermann
ff9cb6d203
drm/udl: Unregister device before cleaning up on disconnect
...
Disconnecting a DisplayLink device results in the following kernel
error messages
[ 93.041748] [drm:udl_urb_completion [udl]] *ERROR* udl_urb_completion - nonzero write bulk status received: -115
[ 93.055299] [drm:udl_submit_urb [udl]] *ERROR* usb_submit_urb error fffffffe
[ 93.065363] [drm:udl_urb_completion [udl]] *ERROR* udl_urb_completion - nonzero write bulk status received: -115
[ 93.078207] [drm:udl_submit_urb [udl]] *ERROR* usb_submit_urb error fffffffe
coming from KMS poll helpers. Shutting down poll helpers runs them
one final time when the USB device is already gone.
Run drm_dev_unplug() first in udl's USB disconnect handler. Udl's
polling code already handles disconnects gracefully if the device has
been marked as unplugged.
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de >
Fixes: b1a981bd55 ("drm/udl: drop drm_driver.release hook")
Cc: dri-devel@lists.freedesktop.org
Cc: <stable@vger.kernel.org > # v5.8+
Reviewed-by: Patrik Jakobsson <patrik.r.jakobsson@gmail.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20250303145604.62962-2-tzimmermann@suse.de
2025-03-24 09:31:01 +01:00
Thomas Zimmermann
edd9231f3a
drm/udl: Set struct drm_device.dma_dev
...
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 <tzimmermann@suse.de >
Reviewed-by: Jani Nikula <jani.nikula@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20250307080836.42848-6-tzimmermann@suse.de
2025-03-12 09:04:01 +01:00
Jani Nikula
cb2e1c2136
drm: remove driver date from struct drm_driver and all drivers
...
We stopped using the driver initialized date in commit 7fb8af6798
("drm: deprecate driver date") and (eventually) started returning "0"
for drm_version ioctl instead.
Finish the job, and remove the unused date member from struct
drm_driver, its initialization from drivers, along with the common
DRIVER_DATE macros.
v2: Also update drivers/accel (kernel test robot)
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com >
Acked-by: Alex Deucher <alexander.deucher@amd.com >
Acked-by: Simon Ser <contact@emersion.fr >
Acked-by: Jeffrey Hugo <quic_jhugo@quicinc.com >
Acked-by: Lucas De Marchi <lucas.demarchi@intel.com >
Acked-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org > # msm
Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de >
Link: https://patchwork.freedesktop.org/patch/msgid/1f2bf2543aed270a06f6c707fd6ed1b78bf16712.1733322525.git.jani.nikula@intel.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com >
2024-12-05 12:35:42 +02:00
Thomas Zimmermann
b86711c6d6
drm/client: Move public client header to clients/ subdirectory
...
Move the public header file drm_client_setup.h to the clients/
subdirectory and update all drivers. No functional changes.
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de >
Reviewed-by: Jocelyn Falempe <jfalempe@redhat.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20241108154600.126162-3-tzimmermann@suse.de
2024-11-15 09:42:13 +01:00
Thomas Zimmermann
266e9dee8b
drm/udl: Run DRM default client setup
...
Call drm_client_setup() to run the kernel's default client setup
for DRM. Set fbdev_probe in struct drm_driver, so that the client
setup can start the common fbdev client.
v5:
- select DRM_CLIENT_SELECTION
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de >
Cc: Dave Airlie <airlied@redhat.com >
Cc: Sean Paul <sean@poorly.run >
Cc: Thomas Zimmermann <tzimmermann@suse.de >
Acked-by: Javier Martinez Canillas <javierm@redhat.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20240924071734.98201-61-tzimmermann@suse.de
2024-09-26 09:31:28 +02:00
Jeff Johnson
665415092e
drm: add missing MODULE_DESCRIPTION() macros
...
On x86, make allmodconfig && make W=1 C=1 reports:
WARNING: modpost: missing MODULE_DESCRIPTION() in drivers/gpu/drm/gud/gud.o
WARNING: modpost: missing MODULE_DESCRIPTION() in drivers/gpu/drm/drm_panel_orientation_quirks.o
WARNING: modpost: missing MODULE_DESCRIPTION() in drivers/gpu/drm/drm_mipi_dbi.o
WARNING: modpost: missing MODULE_DESCRIPTION() in drivers/gpu/drm/i915/kvmgt.o
WARNING: modpost: missing MODULE_DESCRIPTION() in drivers/gpu/drm/udl/udl.o
Add the missing invocation of the MODULE_DESCRIPTION() macro to all
files which have a MODULE_LICENSE().
For consistency this includes drivers/gpu/drm/drm_simple_kms_helper.c
since it contains a MODULE_LICENSE() even though it isn't built as a
separate module -- it is always built as part of drm_kms_helper and
drm_kms_helper_common.c already provides a MODULE_DESCRIPTION for that
module.
Signed-off-by: Jeff Johnson <quic_jjohnson@quicinc.com >
Signed-off-by: Maxime Ripard <mripard@kernel.org >
Link: https://patchwork.freedesktop.org/patch/msgid/20240609-md-drivers-gpu-drm-v1-1-89e9a316d513@quicinc.com
2024-06-10 12:44:39 +02:00
Thomas Zimmermann
0f8c731477
drm/udl: Use fbdev-shmem
...
Implement fbdev emulation with fbdev-shmem. Avoids the overhead of
fbdev-generic's additional shadow buffering. No functional changes.
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de >
Cc: Dave Airlie <airlied@redhat.com >
Cc: Sean Paul <sean@poorly.run >
Cc: Thomas Zimmermann <tzimmermann@suse.de >
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20240419083331.7761-19-tzimmermann@suse.de
2024-05-02 11:33:21 +02:00
Thomas Zimmermann
a47171f083
drm/udl: Remove unnecessary include statements for drm_crtc_helper.h
...
Several source files include drm_crtc_helper.h without needing it or
only to get its transitive include statements; leading to unnecessary
compile-time dependencies.
Directly include required headers and drop drm_crtc_helper.h where
possible.
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de >
Reviewed-by: Sam Ravnborg <sam@ravnborg.org >
Acked-by: Jani Nikula <jani.nikula@intel.com >
Acked-by: Alex Deucher <alexander.deucher@amd.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20230116131235.18917-21-tzimmermann@suse.de
2023-01-18 09:25:32 +01:00
Thomas Zimmermann
8ab59da26b
drm/fb-helper: Move generic fbdev emulation into separate source file
...
Move the generic fbdev implementation into its own source and header
file. Adapt drivers. No functional changes, but some of the internal
helpers have been renamed to fit into the drm_fbdev_ naming scheme.
v3:
* rename drm_fbdev.{c,h} to drm_fbdev_generic.{c,h}
* rebase onto vmwgfx changes
* rebase onto xlnx changes
* fix include statements in amdgpu
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de >
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20221103151446.2638-22-tzimmermann@suse.de
2022-11-05 17:12:04 +01:00
Takashi Iwai
fa47573b04
drm/udl: Sync pending URBs at the end of suspend
...
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 <tzimmermann@suse.de >
Signed-off-by: Takashi Iwai <tiwai@suse.de >
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de >
Link: https://patchwork.freedesktop.org/patch/msgid/20220908095115.23396-13-tiwai@suse.de
2022-09-10 21:45:53 +02:00
Thomas Zimmermann
1ceef996c9
drm/udl: Add reset_resume
...
Implement the reset_resume callback of struct usb_driver. Set the
standard channel when called.
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de >
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch >
Signed-off-by: Takashi Iwai <tiwai@suse.de >
Link: https://patchwork.freedesktop.org/patch/msgid/20220908095115.23396-3-tiwai@suse.de
2022-09-10 21:45:45 +02:00
Thomas Zimmermann
659ab7a49c
drm: Use USB controller's DMA mask when importing dmabufs
...
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 <tzimmermann@suse.de >
Fixes: 6eb0233ec2 ("usb: don't inherity DMA properties for USB devices")
Tested-by: Pavel Machek <pavel@ucw.cz >
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
Acked-by: Christian König <christian.koenig@amd.com >
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch >
Acked-by: Noralf Trønnes <noralf@tronnes.org >
Cc: Christoph Hellwig <hch@lst.de >
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
Cc: <stable@vger.kernel.org > # v5.10+
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de >
Link: https://patchwork.freedesktop.org/patch/msgid/20210303133229.3288-1-tzimmermann@suse.de
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com >
2021-03-11 11:11:33 +01:00
Thomas Zimmermann
2f04636f49
drm/shmem-helper: Removed drm_gem_shmem_create_object_cached()
...
Cached page mappings are now the default for SHMEM GEM objects. Remove
the obsolete create function for cached mappings.
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de >
Acked-by: Maxime Ripard <mripard@kernel.org >
Link: https://patchwork.freedesktop.org/patch/msgid/20201117133156.26822-3-tzimmermann@suse.de
2020-11-24 09:10:33 +01:00
Thomas Zimmermann
3fb91f56ae
drm/udl: Retrieve USB device from struct drm_device.dev
...
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 <tzimmermann@suse.de >
Reviewed-by: Hans de Goede <hdegoede@redhat.com >
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch >
Link: https://patchwork.freedesktop.org/patch/msgid/20201103113456.3066-3-tzimmermann@suse.de
2020-11-09 09:16:13 +01:00
Daniel Vetter
70a59dd829
drm/<drivers>: Constify struct drm_driver
...
Only the following drivers aren't converted:
- amdgpu, because of the driver_feature mangling due to virt support.
Subsequent patch will address this.
- nouveau, because DRIVER_ATOMIC uapi is still not the default on the
platforms where it's supported (i.e. again driver_feature mangling)
- vc4, again because of driver_feature mangling
- qxl, because the ioctl table is somewhere else and moving that is
maybe a bit too much, hence the num_ioctls assignment prevents a
const driver structure.
- arcpgu, because that is stuck behind a pending tiny-fication series
from me.
- legacy drivers, because legacy requires non-const drm_driver.
Note that for armada I also went ahead and made the ioctl array const.
Only cc'ing the driver people who've not been converted (everyone else
is way too much).
v2: Fix one misplaced const static, should be static const (0day)
v3:
- Improve commit message (Sam)
Acked-by: Sam Ravnborg <sam@ravnborg.org >
Cc: kernel test robot <lkp@intel.com >
Acked-by: Maxime Ripard <mripard@kernel.org >
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch >
Cc: Sam Ravnborg <sam@ravnborg.org >
Cc: Dave Airlie <airlied@redhat.com >
Cc: Gerd Hoffmann <kraxel@redhat.com >
Cc: virtualization@lists.linux-foundation.org
Cc: Harry Wentland <harry.wentland@amd.com >
Cc: Leo Li <sunpeng.li@amd.com >
Cc: Alex Deucher <alexander.deucher@amd.com >
Cc: Christian König <christian.koenig@amd.com >
Cc: Eric Anholt <eric@anholt.net >
Cc: Maxime Ripard <mripard@kernel.org >
Cc: Ben Skeggs <bskeggs@redhat.com >
Cc: nouveau@lists.freedesktop.org
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20201104100425.1922351-5-daniel.vetter@ffwll.ch
2020-11-06 10:31:26 +01:00
Thomas Zimmermann
99f55c798f
drm/udl: Use GEM vmap/mmap function from SHMEM helpers
...
The udl driver contains an implementation of GEM vmap and mmap
operations that is identical to the common SHMEM helper; except
that udl's code uses cached pages by default.
Convert udl to regular SHMEM helper functions. There's no reason
to have udl behave differently from all other SHMEM drivers. The
udl driver uses the SHMEM helper to enable caching.
v3:
* rebased onto Daniel's shmem untangle series
v2:
* implement .gem_create_object with SHMEM helper
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de >
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20200609090820.20256-3-tzimmermann@suse.de
2020-06-10 10:17:21 +02:00
Daniel Vetter
6ae355a260
drm/udl: don't set drm_device->dev_private
...
We're mostly there already, just a handful of places that didn't use
the to_udl container_of cast. To make sure no new appear, don't set
->dev_private.
Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de >
Acked-by: Sam Ravnborg <sam@ravnborg.org >
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com >
Cc: Dave Airlie <airlied@redhat.com >
Cc: Sean Paul <sean@poorly.run >
Cc: Emil Velikov <emil.l.velikov@gmail.com >
Cc: Thomas Zimmermann <tzimmermann@suse.de >
Cc: Daniel Vetter <daniel.vetter@ffwll.ch >
Cc: Alexios Zavras <alexios.zavras@intel.com >
Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com >
Cc: Thomas Gleixner <tglx@linutronix.de >
Cc: "José Roberto de Souza" <jose.souza@intel.com >
Cc: Sam Ravnborg <sam@ravnborg.org >
Cc: Gerd Hoffmann <kraxel@redhat.com >
Cc: Allison Randal <allison@lohutok.net >
Link: https://patchwork.freedesktop.org/patch/msgid/20200415074034.175360-13-daniel.vetter@ffwll.ch
2020-04-28 15:18:27 +02:00
Daniel Vetter
50b9bbecaa
drm/udl: Use devm_drm_dev_alloc
...
With Thomas' patch to clean up fbdev init this is a rather standard
conversion to the new wrapper macro.
v2: Rebase on top of Thomas' patches to remove the return value from
drm_fbdev_generic_setup()
v3: Update commit message to reflect the reality of the rebased patch
(Sam)
Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de >
Acked-by: Sam Ravnborg <sam@ravnborg.org >
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com >
Cc: Noralf Trønnes <noralf@tronnes.org >
Cc: Dave Airlie <airlied@redhat.com >
Cc: Sean Paul <sean@poorly.run >
Cc: Thomas Zimmermann <tzimmermann@suse.de >
Cc: Daniel Vetter <daniel.vetter@ffwll.ch >
Cc: Emil Velikov <emil.l.velikov@gmail.com >
Cc: Sam Ravnborg <sam@ravnborg.org >
Cc: Thomas Gleixner <tglx@linutronix.de >
Link: https://patchwork.freedesktop.org/patch/msgid/20200415074034.175360-12-daniel.vetter@ffwll.ch
2020-04-28 15:16:43 +02:00
Thomas Zimmermann
66459fa21d
drm/udl: Remove error check from fbdev setup
...
Remove the error check from the fbdev setup function. The driver's
probe function should not depend on a DRM client's state.
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de >
Reviewed-by: Noralf Trønnes <noralf@tronnes.org >
Acked-by: Sam Ravnborg <sam@ravnborg.org >
Acked-by: Gerd Hoffmann <kraxel@redhat.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20200408082641.590-9-tzimmermann@suse.de
2020-04-08 16:24:59 +02:00
Daniel Vetter
b1a981bd55
drm/udl: drop drm_driver.release hook
...
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 <tzimmermann@suse.de >
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com >
Cc: Dave Airlie <airlied@redhat.com >
Cc: Sean Paul <sean@poorly.run >
Cc: Daniel Vetter <daniel.vetter@ffwll.ch >
Cc: Thomas Zimmermann <tzimmermann@suse.de >
Cc: Emil Velikov <emil.l.velikov@gmail.com >
Cc: Gerd Hoffmann <kraxel@redhat.com >
Cc: "Noralf Trønnes" <noralf@tronnes.org >
Cc: Sam Ravnborg <sam@ravnborg.org >
Cc: Thomas Gleixner <tglx@linutronix.de >
Cc: Alex Deucher <alexander.deucher@amd.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20200323144950.3018436-51-daniel.vetter@ffwll.ch
2020-03-26 16:09:40 +01:00
Daniel Vetter
fe5b7c86d6
drm/udl: Drop explicit drm_mode_config_cleanup call
...
It's right above the drm_dev_put().
This allows us to delete a bit of onion unwinding in
udl_modeset_init().
This is made possible by a preceeding patch which added a drmm_
cleanup action to drm_mode_config_init(), hence all we need to do to
ensure that drm_mode_config_cleanup() is run on final drm_device
cleanup is check the new error code for _init().
v2: Explain why this cleanup is possible (Laurent).
v3: Use drmm_mode_config_init() for more clarity (Sam, Thomas)
Acked-by: Thomas Zimmermann <tzimmermann@suse.de >
Cc: Sam Ravnborg <sam@ravnborg.org >
Cc: Thomas Zimmermann <tzimmermann@suse.de >
Acked-by: Sam Ravnborg <sam@ravnborg.org >
Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com >
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com >
Cc: Dave Airlie <airlied@redhat.com >
Cc: Sean Paul <sean@poorly.run >
Cc: Daniel Vetter <daniel.vetter@ffwll.ch >
Cc: Thomas Zimmermann <tzimmermann@suse.de >
Cc: Emil Velikov <emil.l.velikov@gmail.com >
Cc: Gerd Hoffmann <kraxel@redhat.com >
Cc: "Noralf Trønnes" <noralf@tronnes.org >
Cc: Thomas Gleixner <tglx@linutronix.de >
Cc: Sam Ravnborg <sam@ravnborg.org >
Link: https://patchwork.freedesktop.org/patch/msgid/20200323144950.3018436-50-daniel.vetter@ffwll.ch
2020-03-26 16:09:25 +01:00
Daniel Vetter
d33b58d011
drm: Garbage collect drm_dev_fini
...
It has become empty. Given the few users I figured not much point
splitting this up.
v2: Rebase over i915 changes.
v3: Rebase over patch split fix.
Acked-by: Sam Ravnborg <sam@ravnborg.org >
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20200323144950.3018436-26-daniel.vetter@ffwll.ch
2020-03-26 15:45:36 +01:00
Daniel Vetter
d0c116adc6
drm/udl: Use drmm_add_final_kfree
...
With this we can drop the final kfree from the release function.
v2: We need drm_dev_put to unroll the driver creation (once
drm_dev_init and drmm_add_final_kfree suceeded), otherwise
the drmm_ magic doesn't happen.
v3: Actually squash in the fixup (Laurent).
Acked-by: Thomas Zimmermann <tzimmermann@suse.de >
Acked-by: Sam Ravnborg <sam@ravnborg.org >
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com >
Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com >
Cc: Dave Airlie <airlied@redhat.com >
Cc: Sean Paul <sean@poorly.run >
Cc: Thomas Zimmermann <tzimmermann@suse.de >
Cc: Emil Velikov <emil.l.velikov@gmail.com >
Cc: Daniel Vetter <daniel.vetter@ffwll.ch >
Cc: "Noralf Trønnes" <noralf@tronnes.org >
Cc: Thomas Gleixner <tglx@linutronix.de >
Cc: Sam Ravnborg <sam@ravnborg.org >
Link: https://patchwork.freedesktop.org/patch/msgid/20200323144950.3018436-7-daniel.vetter@ffwll.ch
2020-03-26 14:49:58 +01:00
Thomas Zimmermann
d8177841aa
drm/udl: Set preferred color depth to 16 bpp
...
The current default color depth of 24 bpp is not even supported by
the driver. Being the native format for communicating with the adapter,
16 bpp is the correct choice.
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de >
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20191210084905.5570-6-tzimmermann@suse.de
2019-12-11 17:02:16 +01:00
Thomas Zimmermann
ae08b88aea
drm/udl: Switch to atomic suspend/resume helpers
...
We can use the generic suspend/resume helpers for atomic modesetting.
Switch udl over.
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de >
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20191210084905.5570-4-tzimmermann@suse.de
2019-12-11 17:02:16 +01:00
Thomas Zimmermann
9fda81e00e
drm/udl: Convert to struct drm_simple_display_pipe
...
Udl has a single display pipeline with a primary plane; perfect for
simple-pipe helpers. Convert it over. The old encoder and CRTC code
becomes unused and obsolete.
Exported formats for the primary plane are RGB565 and XRGB8888, with
the latter being emulated. The 16-bit format is the default and what
is used when communicating with the device.
This patch enables atomic modesetting for udl devices.
v3:
* remove unused field crtc from struct udl_device
* set crtc_state->no_vblank at beginning of enable()
v2:
* move suspend/resume changes into separate patch
* remove non-atomic code
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de >
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20191210084905.5570-3-tzimmermann@suse.de
2019-12-11 17:02:16 +01:00
Thomas Zimmermann
d0c4fc5a48
drm/udl: Replace fbdev code with generic emulation
...
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 <tzimmermann@suse.de >
Reviewed-by: Noralf Trønnes <noralf@tronnes.org >
Link: https://patchwork.freedesktop.org/patch/msgid/20191114125106.28347-2-tzimmermann@suse.de
2019-11-19 14:37:29 +01:00
Thomas Zimmermann
08b22f65b3
drm/udl: Switch to SHMEM
...
Udl's GEM code and the generic SHMEM are almost identical. Replace
the former with SHMEM. The dmabuf support in udl is being replaced
with generic GEM PRIME functions.
The main difference is in the caching flags for mmap pages. By
default, SHMEM always sets (uncached) write combining. In udl's
memory management code, only imported buffers use write combining.
Memory pages of locally created buffer objects are mmap'ed with
caching enabled. To keep the optimization, udl provides its own
mmap function for GEM objects where it fixes up the mapping flags.
v3:
- restore udl vmap that enables caching
v2:
- remove obsolete code in a separate patch
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de >
Acked-by: Gerd Hoffmann <kraxel@redhat.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20191107094307.19870-4-tzimmermann@suse.de
2019-11-08 12:30:07 +01:00
Thomas Zimmermann
1d48b9e988
drm/udl: Allocate GEM object via struct drm_driver.gem_create_object
...
In preparation of a switch to SHMEM, udl now allocates its GEM
objects via struct drm_driver.gem_create_object. No functional
changes are made.
For SHMEM GEM objects, udl will require the use of a special mmap
function, which we set though the create-object function.
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de >
Acked-by: Gerd Hoffmann <kraxel@redhat.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20191107094307.19870-3-tzimmermann@suse.de
2019-11-08 12:29:56 +01:00
Sam Ravnborg
a9dcf3804a
drm/udl: drop use of drmP.h
...
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 <sam@ravnborg.org >
Acked-by: Emil Velikov <emil.velikov@collabora.com >
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Cc: Sean Paul <sean@poorly.run >
Cc: David Airlie <airlied@linux.ie >
Cc: Daniel Vetter <daniel@ffwll.ch >
Cc: Jani Nikula <jani.nikula@intel.com >
Cc: Robert Tarasov <tutankhamen@chromium.org >
Cc: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com >
Cc: Thomas Zimmermann <tzimmermann@suse.de >
Cc: "Noralf Trønnes" <noralf@tronnes.org >
Cc: Eric Anholt <eric@anholt.net >
Cc: Mikulas Patocka <mpatocka@redhat.com >
Cc: Emil Lundmark <lndmrk@chromium.org >
Cc: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20190716064220.18157-9-sam@ravnborg.org
2019-07-17 12:52:55 +02:00
Daniel Vetter
0424fdaf88
drm/prime: Actually remove DRIVER_PRIME everywhere
...
Split out to make the functional changes stick out more.
All places where DRIVER_PRIME was used have been removed in previous
patches already.
v2: amdgpu gained DRIVER_SYNCOBJ_TIMELINE.
v3: amdgpu lost DRIVER_SYNCOBJ_TIMELINE.
v4: Don't add a space in i915_drv.c (Sam)
v5: Add note that previous patches removed all the DRIVER_PRIME users
already (Emil).
v6: Fixupe ingenic (new driver) while applying.
Cc: Sam Ravnborg <sam@ravnborg.org >
Reviewed-by: Emil Velikov <emil.velikov@collabora.com >
Reviewed-by: Eric Anholt <eric@anholt.net >
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com >
Cc: amd-gfx@lists.freedesktop.org
Cc: etnaviv@lists.freedesktop.org
Cc: freedreno@lists.freedesktop.org
Cc: intel-gfx@lists.freedesktop.org
Cc: lima@lists.freedesktop.org
Cc: linux-amlogic@lists.infradead.org
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-arm-msm@vger.kernel.org
Cc: linux-aspeed@lists.ozlabs.org
Cc: linux-renesas-soc@vger.kernel.org
Cc: linux-rockchip@lists.infradead.org
Cc: linux-samsung-soc@vger.kernel.org
Cc: linux-stm32@st-md-mailman.stormreply.com
Cc: linux-tegra@vger.kernel.org
Cc: nouveau@lists.freedesktop.org
Cc: NXP Linux Team <linux-imx@nxp.com >
Cc: spice-devel@lists.freedesktop.org
Cc: virtualization@lists.linux-foundation.org
Cc: VMware Graphics <linux-graphics-maintainer@vmware.com >
Cc: xen-devel@lists.xenproject.org
Link: https://patchwork.freedesktop.org/patch/msgid/20190617153924.414-1-daniel.vetter@ffwll.ch
2019-06-21 17:30:32 +02:00
Thomas Gleixner
12eb90f1ed
treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 262
...
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 <tglx@linutronix.de >
Reviewed-by: Alexios Zavras <alexios.zavras@intel.com >
Reviewed-by: Allison Randal <allison@lohutok.net >
Reviewed-by: Richard Fontana <rfontana@redhat.com >
Cc: linux-spdx@vger.kernel.org
Link: https://lkml.kernel.org/r/20190529141333.582369016@linutronix.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2019-06-05 17:30:28 +02:00
Dave Airlie
6ecac85ead
drm/udl: move to embedding drm device inside udl device.
...
This should help with some of the lifetime issues, and move us away
from load/unload.
Acked-by: Alex Deucher <alexander.deucher@amd.com >
Signed-off-by: Dave Airlie <airlied@redhat.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20190405031715.5959-4-airlied@gmail.com
2019-04-24 13:48:45 +10:00
Dave Airlie
f06ddb5309
BackMerge v5.1-rc5 into drm-next
...
Need rc5 for udl fix to add udl cleanups on top.
Signed-off-by: Dave Airlie <airlied@redhat.com >
2019-04-15 15:51:49 +10:00
Dave Airlie
9b39b01303
drm/udl: add a release method and delay modeset teardown
...
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: stable@vger.kernel.org
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch >
Signed-off-by: Dave Airlie <airlied@redhat.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20190405031715.5959-2-airlied@gmail.com
2019-04-08 16:20:02 +10:00
Noralf Trønnes
ba3bf37e15
drm/drv: drm_dev_unplug(): Move out drm_dev_put() call
...
This makes it possible to use drm_dev_unplug() with the upcoming
devm_drm_dev_init() which will do drm_dev_put() in its release callback.
Cc: Alex Deucher <alexander.deucher@amd.com >
Cc: Christian König <christian.koenig@amd.com >
Cc: David (ChunMing) Zhou <David1.Zhou@amd.com >
Cc: Dave Airlie <airlied@redhat.com >
Cc: Sean Paul <sean@poorly.run >
Cc: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com >
Cc: Daniel Vetter <daniel.vetter@ffwll.ch >
Signed-off-by: Noralf Trønnes <noralf@tronnes.org >
Acked-by: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com >
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch >
Link: https://patchwork.freedesktop.org/patch/msgid/20190208140103.28919-3-noralf@tronnes.org
2019-02-21 12:11:58 +01:00
Daniel Vetter
fcd70cd36b
drm: Split out drm_probe_helper.h
...
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 <harry.wentland@amd.com >
Acked-by: Sam Ravnborg <sam@ravnborg.org >
Cc: Sam Ravnborg <sam@ravnborg.org >
Cc: Jani Nikula <jani.nikula@linux.intel.com >
Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com >
Acked-by: Rodrigo Vivi <rodrigo.vivi@intel.com >
Acked-by: Benjamin Gaignard <benjamin.gaignard@linaro.org >
Acked-by: Jani Nikula <jani.nikula@intel.com >
Acked-by: Neil Armstrong <narmstrong@baylibre.com >
Acked-by: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com >
Acked-by: CK Hu <ck.hu@mediatek.com >
Acked-by: Alex Deucher <alexander.deucher@amd.com >
Acked-by: Sam Ravnborg <sam@ravnborg.org >
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com >
Acked-by: Liviu Dudau <liviu.dudau@arm.com >
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com >
Cc: linux-arm-kernel@lists.infradead.org
Cc: virtualization@lists.linux-foundation.org
Cc: etnaviv@lists.freedesktop.org
Cc: linux-samsung-soc@vger.kernel.org
Cc: intel-gfx@lists.freedesktop.org
Cc: linux-mediatek@lists.infradead.org
Cc: linux-amlogic@lists.infradead.org
Cc: linux-arm-msm@vger.kernel.org
Cc: freedreno@lists.freedesktop.org
Cc: nouveau@lists.freedesktop.org
Cc: spice-devel@lists.freedesktop.org
Cc: amd-gfx@lists.freedesktop.org
Cc: linux-renesas-soc@vger.kernel.org
Cc: linux-rockchip@lists.infradead.org
Cc: linux-stm32@st-md-mailman.stormreply.com
Cc: linux-tegra@vger.kernel.org
Cc: xen-devel@lists.xen.org
Link: https://patchwork.freedesktop.org/patch/msgid/20190117210334.13234-1-daniel.vetter@ffwll.ch
2019-01-24 13:20:42 +01:00
Thomas Zimmermann
ac3b35f11a
drm/udl: Replace drm_dev_unref with drm_dev_put
...
This patch unifies the naming of DRM functions for reference counting
of struct drm_device. The resulting code is more aligned with the rest
of the Linux kernel interfaces.
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de >
Signed-off-by: Sean Paul <seanpaul@chromium.org >
Link: https://patchwork.freedesktop.org/patch/msgid/20180926120212.25359-1-tzimmermann@suse.de
2018-09-26 09:34:11 -04:00
Daniel Vetter
ae358dacd2
drm/udl: Get rid of dev->struct_mutex usage
...
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 <daniel.vetter@intel.com >
Cc: Dave Airlie <airlied@redhat.com >
Reviewed-by: Sean Paul <seanpaul@chromium.org >
Link: https://patchwork.freedesktop.org/patch/msgid/20180327082356.24516-3-daniel.vetter@ffwll.ch
2018-03-28 17:07:36 +02:00
Robert Tarasov
afdfc4c6f5
drm/udl: Fixed problem with UDL adpater reconnection
...
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 <tutankhamen@chromium.org >
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20171013001350.172155-1-tutankhamen@chromium.org
2017-10-16 15:36:02 -04:00
Arvind Yadav
36436f4e93
drm: udl: constify usb_device_id
...
usb_device_id are not supposed to change at runtime. All functions
working with usb_device_id provided by <linux/usb.h> work with
const usb_device_id. So mark the non-const structs as const.
Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com >
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch >
Link: https://patchwork.freedesktop.org/patch/msgid/22fa8ca67a6d4a59997f463bf241ed56596fbcfa.1502526524.git.arvind.yadav.cs@gmail.com
2017-08-18 09:10:46 +02:00
Noralf Trønnes
e966f5df9c
drm/udl: Use the drm_driver.dumb_destroy default
...
drm_gem_dumb_destroy() is the drm_driver.dumb_destroy default,
so no need to set it.
Cc: Dave Airlie <airlied@redhat.com >
Signed-off-by: Noralf Trønnes <noralf@tronnes.org >
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch >
Link: https://patchwork.freedesktop.org/patch/msgid/1502034068-51384-9-git-send-email-noralf@tronnes.org
2017-08-16 20:14:58 +02:00
Daniel Vetter
c07dcd61a0
drm: Document device unplug infrastructure
...
While at it, also ocd and give them a consistent drm_dev_ prefix, like
the other device instance functionality. Plus move the functions into
the right places.
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20170802115604.12734-3-daniel.vetter@ffwll.ch
2017-08-11 10:48:03 +02:00
Daniel Vetter
76bba2cdb5
drm/udl: Remove dummy busid callback
...
Since
commit ca8e2ad710
Author: Thierry Reding <treding@nvidia.com >
Date: Fri Apr 11 15:23:00 2014 +0200
drm: Introduce drm_dev_set_unique()
the ->set_busid callback is optional. On top of that the udl one isn't
really fully compliant with the drm uabi, but since only modesetting
ever binds to it (there's no 3d accel on udl) it doesn't matter.
Still, can't harm to aling and use the default used by everyone else.
Acked-by: Thierry Reding <treding@nvidia.com >
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com >
Link: http://patchwork.freedesktop.org/patch/msgid/20170524145212.27837-4-daniel.vetter@ffwll.ch
2017-06-20 10:40:31 +02:00
Jani Nikula
55edf41b69
drm: define drm_compat_ioctl NULL on CONFIG_COMPAT=n and reduce #ifdefs
...
If we define drm_compat_ioctl NULL on CONFIG_COMPAT=n, we don't have to
check for the config everywhere.
Reviewed-by: Patrik Jakobsson <patrik.r.jakobsson@gmail.com >
Signed-off-by: Jani Nikula <jani.nikula@intel.com >
Signed-off-by: Sean Paul <seanpaul@chromium.org >
Link: http://patchwork.freedesktop.org/patch/msgid/1478014844-27454-1-git-send-email-jani.nikula@intel.com
2016-11-02 11:33:47 -04:00
Tom Gundersen
0f2886057b
drm: Don't swallow error codes in drm_dev_alloc()
...
There are many reasons other than ENOMEM that drm_dev_init() can
fail. Return ERR_PTR rather than NULL to be able to distinguish
these in the caller.
Signed-off-by: Tom Gundersen <teg@jklm.no >
Signed-off-by: Sean Paul <seanpaul@chromium.org >
Link: http://patchwork.freedesktop.org/patch/msgid/20160921145919.13754-2-teg@jklm.no
2016-09-22 04:03:48 -07:00
Haixia Shi
737ba10928
drm/udl: implement usb_driver suspend/resume.
...
The usb_driver suspend and resume function pointers must be populated
to prevent forced unbinding of USB interface driver. See usb/core/driver.c:
unbind_no_pm_drivers_interfaces().
Restore mode and damage the entire frame buffer upon resume.
TEST=suspend and resume with the same UDL device connected
TEST=suspend with UDL, unplug UDL and resume
TEST=suspend with UDL, unplug and connect another UDL device then resume
Signed-off-by: Haixia Shi <hshi@chromium.org >
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org >
[seanpaul fixed checkpatch warnings and gave marcheu his é back]
Signed-off-by: Sean Paul <seanpaul@chromium.org >
Link: http://patchwork.freedesktop.org/patch/msgid/1472593821-38429-2-git-send-email-hshi@chromium.org
2016-09-06 13:56:42 -04:00
Chris Wilson
8326439623
drm/udl: Unplugging a device now unregisters it
...
Rather than manually perform our unregistration actions before shutting
down the device, move them to drm_unplug_dev().
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk >
Cc: David Airlie <airlied@linux.ie >
Cc: Daniel Vetter <daniel.vetter@ffwll.ch >
Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com >
Cc: Alexey Brodkin <Alexey.Brodkin@synopsys.com >
Cc: Amitoj Kaur Chawla <amitoj1606@gmail.com >
Cc: dri-devel@lists.freedesktop.org
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch >
Link: http://patchwork.freedesktop.org/patch/msgid/1466778982-6974-4-git-send-email-chris@chris-wilson.co.uk
2016-07-12 13:01:55 +02:00