Commit graph

100 commits

Author SHA1 Message Date
Linus Torvalds 02061181d3 Staging/IIO driver patches for 4.21-rc1
Here is the big staging and iio driver pull request for 4.21-rc1.
 
 Lots and lots of tiny patches here, nothing major at all.  Which is
 good, tiny cleanups is nice to see.  No new huge driver removal or
 addition, this release cycle, although there are lots of good IIO driver
 changes, addtions, and movement from staging into the "real" part of the
 kernel, which is always great.
 
 Full details are in the shortlog, and all of these have been in
 linux-next for a while with no reported issues.
 
 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
 -----BEGIN PGP SIGNATURE-----
 
 iG0EABECAC0WIQT0tgzFv3jCIUoxPcsxR9QN2y37KQUCXCY93w8cZ3JlZ0Brcm9h
 aC5jb20ACgkQMUfUDdst+ymJRwCfeV0x/+IMS0UGh9ltHnUfCfR9bcgAmgPWMPnY
 bauRCLkceTjzODOR4SzH
 =o6Fs
 -----END PGP SIGNATURE-----

Merge tag 'staging-4.21-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging

Pull staging/IIO driver updates from Greg KH:
 "Here is the big staging and iio driver pull request for 4.21-rc1.

  Lots and lots of tiny patches here, nothing major at all. Which is
  good, tiny cleanups is nice to see. No new huge driver removal or
  addition, this release cycle, although there are lots of good IIO
  driver changes, addtions, and movement from staging into the "real"
  part of the kernel, which is always great.

  Full details are in the shortlog, and all of these have been in
  linux-next for a while with no reported issues"

* tag 'staging-4.21-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging: (553 commits)
  staging: mt7621-mmc: Correct spelling mistakes in comments
  staging: wilc1000: fix missing read_write setting when reading data
  mt7621-mmc: char * array declaration might be better as static const
  mt7621-mmc: return statement in void function unnecessary
  mt7621-mmc: Alignment should match open parenthesis
  mt7621-mmc: Removed unnecessary blank lines
  mt7621-mmc: Fix some coding style issues
  staging: android: ashmem: doc: Fix spelling
  staging: rtl8188eu: cleanup brace coding style issues
  staging: rtl8188eu: add spaces around '&' in rtw_mlme_ext.c
  staging: rtl8188eu: change return type of is_basicrate() to bool
  staging: rtl8188eu: simplify null array initializations
  staging: rtl8188eu: change order of declarations to improve readability
  staging: rtl8188eu: make some arrays static in rtw_mlme_ext.c
  staging: rtl8188eu: constify some arrays
  staging: rtl8188eu: convert unsigned char arrays to u8
  staging: rtl8188eu: remove redundant declaration in rtw_mlme_ext.c
  staging: rtl8188eu: remove unused arrays WFD_OUI and WMM_INFO_OUI
  staging: rtl8188eu: remove unnecessary parentheses in rtw_mlme_ext.c
  staging: rtl8188eu: remove unnecessary comments in rtw_mlme_ext.c
  ...
2018-12-28 20:39:58 -08:00
Dave Airlie 61647c77cb drm-misc-next for v4.21:
Core Changes:
 - Merge drm_info.c into drm_debugfs.c
 - Complete the fake drm_crtc_commit's hw_done/flip_done sooner.
 - Remove deprecated drm_obj_ref/unref functions. All drivers use get/put now.
 - Decrease stack use of drm_gem_prime_mmap.
 - Improve documentation for dumb callbacks.
 
 Driver Changes:
 - Add edid support to virtio.
 - Wait on implicit fence in meson and sun4i.
 - Add support for BGRX8888 to sun4i.
 - Preparation patches for sun4i driver to start supporting linear and tiled YUV formats.
 - Add support for HDMI 1.4 4k modes to meson, and support for VIC alternate timings.
 - Drop custom dumb_map in vkms.
 - Small fixes and cleanups to v3d.
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEuXvWqAysSYEJGuVH/lWMcqZwE8MFAlv+YOEACgkQ/lWMcqZw
 E8OJvw//fc+j9sJLScvrahLDNZVMh4pTvQCOySmxIPVAhjLZIkRjdvR9Ou51tbL+
 qSm3tDexHEPniR8xmuTYjPZtJP6o4e4NLqUzWYdZb0U+oK3QMuJKDD3uK+6BwM8P
 CyAa4VxV9F17oN+d0aFpoPTHheRVt3egyvREqLHoiAJYtp01cm+f/FFKZSe+o3p/
 QLi0tJ5unXg6AZFoomYbZirE/jp6t8m+cjRkYOafE57+2qpMEJ8RA5G0D1UxCgP2
 imGW6n4N7rmB1bNbtTvFEDGIffE+W9AkVQkJ2YXUfQldtmUKgLA9OG47DIdDb1Xa
 P7RWVjHJejhvu9URcFmQcrjoCtKURPcPTuLZEQHvae1sUxwwMUvtpKUM7TBGYo2I
 G/nQLkMLmK9yfJRyo2OHRHTClduU3X7FXzbJhbL3cUMx0beWjCQmRDjM9ywfSJR3
 lrJIlnQ3voCp0IZWj86RG0idpd3RIjE8Aaqz/m4bSmqMCqmlepnZzIpZcFB7gXbM
 k0xiK4LUFO1VbFsMoRaqrP1zXduY+nbLhfiDiIDs34v0ZVqNooJpLYilRI/lvmXt
 vzApnxgwRePW0vz67Lagqq+ZUXJXptirmGw7bnvfT90cOKlRLi5CDZTRwCOuUNPL
 9kUgXj8EoX9+7p9M14TrEx9tV0MZIwbP8nlS9Ty0Kx4s240mbYg=
 =JNy2
 -----END PGP SIGNATURE-----

Merge tag 'drm-misc-next-2018-11-28' of git://anongit.freedesktop.org/drm/drm-misc into drm-next

drm-misc-next for v4.21:

Core Changes:
- Merge drm_info.c into drm_debugfs.c
- Complete the fake drm_crtc_commit's hw_done/flip_done sooner.
- Remove deprecated drm_obj_ref/unref functions. All drivers use get/put now.
- Decrease stack use of drm_gem_prime_mmap.
- Improve documentation for dumb callbacks.

Driver Changes:
- Add edid support to virtio.
- Wait on implicit fence in meson and sun4i.
- Add support for BGRX8888 to sun4i.
- Preparation patches for sun4i driver to start supporting linear and tiled YUV formats.
- Add support for HDMI 1.4 4k modes to meson, and support for VIC alternate timings.
- Drop custom dumb_map in vkms.
- Small fixes and cleanups to v3d.

Signed-off-by: Dave Airlie <airlied@redhat.com>

From: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/151a3270-b1be-ed75-bd58-6b29d741f592@linux.intel.com
2018-11-29 10:28:49 +10:00
Daniel Vetter 39dea70d8a drm: Improve dumb callback docs
Noticed while reviewing a patch from Eric. Also add a todo for the
dumb_map_offset callbacks (it should be simple to do, but piles of
work). Plus fix up vbox, because vbox.

Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Cc: Maxime Ripard <maxime.ripard@bootlin.com>
Cc: Sean Paul <sean@poorly.run>
Cc: David Airlie <airlied@linux.ie>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Hans de Goede <hdegoede@redhat.com>
Cc: Nicholas Mc Guire <der.herr@hofr.at>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Fabio Rafael da Rosa <fdr@pid42.net>
Reviewed-by: Maxime Ripard <maxime.ripard@bootlin.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/20181127091921.8325-1-daniel.vetter@ffwll.ch
2018-11-27 15:23:18 +01:00
Ricardo Reis Marques Silva 16c44c57ec staging: vboxvideo: Rename uint32_t type to u32
Issue found by checkpatch.

CHECK: Prefer kernel type 'u32' over 'uint32_t'
+static const uint32_t vbox_cursor_plane_formats[] = {

CHECK: Prefer kernel type 'u32' over 'uint32_t'
+static const uint32_t vbox_primary_plane_formats[] = {

CHECK: Prefer kernel type 'u32' over 'uint32_t'
+       const uint32_t *formats;

Signed-off-by: Ricardo Reis Marques Silva <ricardormsilva93@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-11-23 10:58:47 +01:00
Hans de Goede fafb85b45f staging: vboxvideo: Use DRM_FB_HELPER_DEFAULT_OPS
Use DRM_FB_HELPER_DEFAULT_OPS rather then open-coding it.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-11-07 12:59:50 +01:00
Hans de Goede 3a9b6ecade staging: vboxvideo: Drop DRM_MODE_FB_CMD define
This is a leftover from when the driver was out of tree and also build
against older kernels.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-11-07 12:59:50 +01:00
Hans de Goede e46b06e1fe staging: vboxvideo: Add myself as MODULE_AUTHOR
Add myself as MODULE_AUTHOR.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-11-07 12:59:50 +01:00
Hans de Goede 35a703dfdc staging: vboxvideo: Fixup some #ifdef-s
Add #ifdef CONFIG_PM_SLEEP around the suspend/hibernate functions.

Remove unnecessary #ifdef CONFIG_COMPAT, the .compat_ioctl member is
always available and if CONFIG_COMPAT is not set then drm_compat_ioctl
is defined to NULL.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-11-07 12:59:50 +01:00
Hans de Goede 650d4aad03 staging: vboxvideo: Use PCI_DEVICE() for our pci_id table
Use PCI_DEVICE() for our pci_id table and also simplify the terminating
entry tio just "{ }".

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-11-07 12:59:50 +01:00
Hans de Goede 0a2bca1409 staging: vboxvideo: Cleanup header use
Stop adding -Iinclude/drm to the CFLAGS and stop using the obsolete
"include-all" drm/drmP.h header.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-11-07 12:59:50 +01:00
Hans de Goede 40497c5237 staging: vboxvideo: Stop disabling/enabling accel support on master set / drop
Userspace mode-setting (and thus also VESA) is not supported together with
modesetting. KMS userspace apps not properly marking the framebuffer as
dirty are also not supported.

So stop trying to accommodate this and simply enable accel
once at driver init.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-11-07 12:27:33 +01:00
Hans de Goede acc962c514 staging: vboxvideo: Change licence headers over to SPDX
All the files contain a MIT license header, replace this with:
SPDX-License-Identifier: MIT

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-11-07 12:27:33 +01:00
Hans de Goede cd76c287a5 staging: vboxvideo: Cleanup the comments
Some comments where still using docbook style comments, move these
either over to kerneldoc, or just make them regular comments.

Also remove a bunch of obsolete comments.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-11-07 12:27:33 +01:00
Hans de Goede 685bb884e0 staging: vboxvideo: Drop duplicate vbox_err.h file
Switch to the more complete vbox_err.h file from include/linux which got
added with the merging of the vboxguest driver.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-11-07 12:27:33 +01:00
Hans de Goede db3566cfbf staging: vboxvideo: Keep old mode when disable crtc
On DPMS off we get a call to vbx_crtc_atomic_disable, followed by
a call to vbox_primary_atomic_update, at which point crtc_state->enable
is 0 and crtc_state->mode has been zero-ed. On a 0 width/height
vbox_do_modeset() falls back to 640x480, so this causes the guest Window
(its "monitor") to resize to 640x480 (and become black).

This commit makes us not look at crtc_state->mode when crtc_state->enable
is not set, so that we keep the old mode and just make the window go black.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-11-07 12:27:33 +01:00
Hans de Goede ba2181d76e staging: vboxvideo: Stop accessing crtc_state->active
Atomic modesetting drivers should never check crtc_state->active directly,
instead check crtc_state->enable.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-11-07 12:27:33 +01:00
Christian König a64f784bb1 drm/ttm: initialize globals during device init (v2)
Make sure that the global BO state is always correctly initialized.

This allows removing all the device code to initialize it.

v2: fix up vbox (Alex)

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Junwei Zhang <Jerry.Zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2018-11-05 14:21:21 -05:00
Christian König 27eb1fa913 drm/ttm: use a static ttm_mem_global instance
As the name says we only need one global instance of ttm_mem_global.

Drop all the driver initialization and just use a single exported
instance which is initialized during BO global initialization.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Junwei Zhang <Jerry.Zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2018-11-05 14:21:18 -05:00
Thomas Zimmermann e55a5c9b5f drm/ttm: Rename ttm_bo_global_{init,release}() to ttm_bo_global_ref_{,}()
The functions ttm_bo_global_init() and ttm_bo_global_release() do not
receive an argument of type struct ttm_bo_global. Both take a struct
drm_global_reference that contains points to a struct ttm_bo_global_ref.
Renaming them reflects this.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2018-11-05 14:20:52 -05:00
Shayenne da Luz Moura dff94010b3 staging: vboxvideo: Remove unnecessary parentheses
Remove unneeded parentheses around the arguments of ||. This reduces
clutter and code behave in the same way.
Change suggested by checkpatch.pl.

vbox_main.c:119: CHECK: Unnecessary parentheses around 'rects[i].x2 <
crtc->x'

Signed-off-by: Shayenne da Luz Moura <shayenneluzmoura@gmail.com>
Acked-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-11-05 14:53:58 +01:00
Linus Torvalds 738b04fba1 Staging/IIO patches for 4.20-rc1
Here is the big staging and IIO driver pull request for 4.20-rc1.
 
 There are lots of things here, we ended up adding more lines than
 removing, thanks to a large influx of Comedi National Instrument device
 support.  Someday soon we need to get comedi out of staging...
 
 Other than the comedi drivers, the "big" things here are:
   - new iio drivers
   - delete dgnc driver (no one used it and no one had the hardware
     anymore)
   - vbox driver updates and fixes
   - erofs fixes
   - tons and tons of tiny checkpatch fixes for almost all staging
     drivers
 
 All of these have been in linux-next, with the last few happening a bit
 "late" due to them getting stuck on my laptop during travel to the
 Mantainers summit.
 
 When merging with your tree, there will be 2 merge conflicts, both files
 will be simple to resolve, just delete them :)
 
 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
 -----BEGIN PGP SIGNATURE-----
 
 iG0EABECAC0WIQT0tgzFv3jCIUoxPcsxR9QN2y37KQUCW9bSGA8cZ3JlZ0Brcm9h
 aC5jb20ACgkQMUfUDdst+yk5eACfYp73m9tLO22rnBcXJ73bWAYSTOMAn2GEL4Nc
 LZBXs8QvvJIwfqmi7ofn
 =UWJn
 -----END PGP SIGNATURE-----

Merge tag 'staging-4.20-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging

Pull staging/IIO driver updates from Greg KH:
 "Here is the big staging and IIO driver pull request for 4.20-rc1.

  There are lots of things here, we ended up adding more lines than
  removing, thanks to a large influx of Comedi National Instrument
  device support. Someday soon we need to get comedi out of staging...

  Other than the comedi drivers, the "big" things here are:

   - new iio drivers

   - delete dgnc driver (no one used it and no one had the hardware
     anymore)

   - vbox driver updates and fixes

   - erofs fixes

   - tons and tons of tiny checkpatch fixes for almost all staging
     drivers

  All of these have been in linux-next, with the last few happening a
  bit "late" due to them getting stuck on my laptop during travel to the
  Mantainers summit"

* tag 'staging-4.20-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging: (690 commits)
  staging: gasket: Fix sparse "incorrect type in assignment" warnings.
  staging: gasket: remove debug logs for callback invocation
  staging: gasket: remove debug logs in page table mapping calls
  staging: rtl8188eu: core: Use sizeof(*p) instead of sizeof(struct P) for memory allocation
  staging: ks7010: Remove extra blank line
  staging: gasket: Remove extra blank line
  staging: media: davinci_vpfe: Fix spelling mistake in enum
  staging: speakup: Add a pair of braces
  staging: wlan-ng: Replace long int with long
  staging: MAINTAINERS: remove obsolete IPX staging directory
  staging: MAINTAINERS: remove NCP filesystem entry
  staging: rtl8188eu: cleanup comparsions to false
  staging: gasket: Update device virtual address comment
  staging: gasket: sysfs: fix attribute release comment
  staging: gasket: apex: fix sysfs_show
  staging: gasket: page_table: simplify gasket_components_to_dev_address
  staging: gasket: page_table: fix comment in components_to_dev_address
  staging: gasket: page table: fixup error path allocating coherent mem
  staging: gasket: page_table: rearrange gasket_page_table_entry
  staging: gasket: page_table: remove unnecessary PTE status set to free
  ...
2018-10-29 10:38:10 -07:00
Craig Kewley 84ac86fbbe staging: vboxvideo: make a couple of funcs static
Fix Sparse warnings:
drivers/staging/vboxvideo/vbox_mode.c:309:6: warning:
symbol 'vbox_primary_atomic_disable' was not declared. Should it be static?

drivers/staging/vboxvideo/vbox_mode.c:452:6: warning:
symbol 'vbox_cursor_atomic_disable' was not declared. Should it be static?

Signed-off-by: Craig Kewley <craigkewley@gmail.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-10-11 12:10:32 +02:00
Dan Carpenter c00e1d09e3 staging: vboxvideo: unlock on error in vbox_cursor_atomic_update()
We need to unlock before returning on this error path.

Fixes: 35f3288c45 ("staging: vboxvideo: Atomic phase 1: convert cursor to universal plane")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-10-11 12:10:32 +02:00
Hans de Goede e2c3860ba2 staging: vboxvideo: Use more drm_fb_helper functions
Store fbhelper and afb struct directly in vbox_private and use
drm_fb_helper_fbdev_setup to replace vbox_fbdev_init, note we cannot use
drm_fb_helper_fbdev_teardown since we use a private framebuffer for the
fbdev.

And replace vbox_driver_lastclose with drm_fb_helper_lastclose.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-09-29 05:31:33 -07:00
Hans de Goede 0c762dda8c staging: vboxvideo: Drop unnecessary drm_connector_helper_funcs callbacks
vbox_mode_valid always returns MODE_OK, which is also the default if no
mode_valid callback is defined.

vbox_best_single_encoder chains to drm_encoder_find, the drm-core will
call drm_encoder_find itself if there is no best_encoder call back.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-09-29 05:31:33 -07:00
Hans de Goede b8384ea3be staging: vboxvideo: Call drm_atomic_helper_check_plane_state from atomic_check
Extend our planes atomic_check callbacks to be more thorough by calling
the drm_atomic_helper_check_plane_state helper.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-09-29 05:31:33 -07:00
Hans de Goede 33f48cc1f1 staging: vboxvideo: Replace crtc_helper enable/disable functions
Replace vbox_crtc_commit and vbox_crtc_disable with
vbox_crtc_atomic_[en|dis]able which are the preferred callbacks for
these for atomic drivers.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-09-29 05:31:33 -07:00
Hans de Goede 04ed7ed769 staging: vboxvideo: Fix DPMS support after atomic conversion
Atomic modesetting does not use the traditional dpms call backs, instead
we should check crtc_state->active.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-09-29 05:31:32 -07:00
Hans de Goede 5cf5332d52 staging: vboxvideo: Restore page-flip support
Restore page-flip support now that the atomic conversion is complete.

Since the mode parameter to vbox_crtc_set_base_and_mode() now never
is NULL call drm_atomic_crtc_needs_modeset() to check if we need to
check for input-mapping changes, to avoid doing unnecesarry work on
a flip. And hookup the drm_atomic_helper_page_flip helper to implement
the page_flip callback.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-09-29 05:31:32 -07:00
Hans de Goede 438340aa20 staging: vboxvideo: Atomic phase 3: Switch last bits over to atomic
Now that the state objects are wired up, we can:

1) Move to the final atomic handlers
2) Wire up atomic set_config helper
3) Switch to drm_mode_config_helper_suspend/resume for suspend/resume
4) Enable atomic modesetting ioctl

This is all done in one commit because doing this piecemeal leads to
an intermediate state which triggers WARN_ONs in the atomic code because
e.g. plane->fb is still being set.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-09-29 05:31:32 -07:00
Hans de Goede 32f2ed7ea7 staging: vboxvideo: Atomic phase 2: Stop using plane->fb and crtc->*
Once we are fully atomic plane->fb will always be NULL and we also
should not access things like crtc->enabled and crt->[hw]mode.

Now that we've wired up the state object handlers, we always have a
plane_state and crtc_state so change the code referencing plane->fb and
crtc->* to use the data from the plane_state and crt_state instead.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-09-29 05:31:32 -07:00
Hans de Goede 67e2f0c80d staging: vboxvideo: Atomic phase 2: Wire up state object handlers
Wire up state object handlers for the crtc-s and the planes, call
drm_mode_config_reset() after creating all the crtc-s and encoders and
remove the legacy drm_helper_disable_unused_functions() call.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-09-29 05:31:32 -07:00
Hans de Goede cc0ec5eb72 staging: vboxvideo: Atomic phase 1: Use drm_plane_helpers for primary plane
Use drm_plane_helpers for the primary plane and replace our custom
mode_set callback with drm_helper_crtc_mode_set.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-09-29 05:31:32 -07:00
Hans de Goede 35f3288c45 staging: vboxvideo: Atomic phase 1: convert cursor to universal plane
In preparation for atomic conversion, let's use the transitional atomic
helpers drm_plane_helper_update/disable.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-09-29 05:31:32 -07:00
Hans de Goede e2f958d00b staging: vboxvideo: Cache mode width, height and crtc panning in vbox_crtc
When setting a mode we not only pass the mode to the hypervisor,
but also information on how to map / translate input coordinates
for the emulated USB tablet.  This input-mapping may change when
the mode on *another* crtc changes.

This means that sometimes we must do a modeset on other crtc-s then
the one being changed to update the input-mapping. Including crtc-s
which may be disabled inside the guest (shown as a black window
on the host unless closed by the user).

With atomic modesetting the mode-info of disabled crtcs gets zeroed
yet we need it when updating the input-map to avoid resizing the
window as a side effect of a mode_set on another crtc.

This commit adds caching of the mode info into out private vbox_crtc
struct so that we always have the info at hand when we need it.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-09-29 05:31:32 -07:00
Hans de Goede 2fab6e7542 staging: vboxvideo: Temporarily remove page_flip support
drm_mode_page_flip_ioctl() cannot deal with the in between phase of
the transitioning to atomic modeset support. Once we start using
drm_helper_crtc_mode_set(), we start setting plane->state on the primary
plane. But we are not fully atomic yet so then set both plane-state->fb
and plane->fb.

If both plane-state->fb and plane->fb are set drm_mode_page_flip_ioctl()
gets confused and stops calling drm_framebuffer_get() on the new fb while
still calling drm_framebuffer_put() on the old fb.

The current page_flip implementation expects drm_mode_page_flip_ioctl()
to take care of both and once we switch to drm_atomic_helper_page_flip()
that will expect neither to be done, taking care of both itself.

So for the transition we need to remove page_flip support and then after
the transition is complete and we set DRIVER_ATOMIC in our driver_features,
we can start using drm_atomic_helper_page_flip().

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-09-29 05:31:32 -07:00
Hans de Goede 880f72829f staging: vboxvideo: Remove empty encoder_helper_funcs
All the encoder_helper_funcs are optional, and even setting the
drm_encoder_helper_funcs vtable itself is optional and may be left out
when not using any of the helper funcs, so lets drop all of this.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-09-29 05:31:32 -07:00
Hans de Goede 8568209b54 staging: vboxvideo: Cleanup vbox_set_up_input_mapping()
This cleanups 2 things:

1) The first time we loop over the crtc-s, to compare framebuffers, fb1 may
get set to NULL by the fb1 = CRTC_FB(crtci); statement and then we call
to_vbox_framebuffer() on it. The result of this call is only used for
an address comparison, so we don't end up dereferencing the bad pointer,
but still it is better to not do this.

2) Since we already figure out the first crtc with a fb in the first loop
and store that in fb1, there is no need to loop over the crtc-s again just
to find the first crtc with a fb again.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-09-29 05:31:32 -07:00
Dave Airlie bf78296ab1 This is the 4.19-rc5 stable release
-----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEEZH8oZUiU471FcZm+ONu9yGCSaT4FAlunyjMACgkQONu9yGCS
 aT52HhAA0JU7E88QPZ1gSxc1ifTaIlHXhLQSvQKAXOhIvHDwj4tEKDqPhpCN/dWX
 /o/xaUf36gU0VzUD/1IyEiMFmJEeFKnfvN5SZYZLk8uSrd4swqaY8mSueZxNEDz4
 YNK9ugI/tPztuuz7I6KrO1iVquY1WlnECxc9FH76wvHsit8Sr3PvzhR+CVrOi+8p
 k3cpWlhHiOzT/3K3Wv2Et+oh+U+myKtQTlJDSe3fMx5chksJpBmsV/IDEtsLNZfz
 3v25fHz5a3DOYqKkGJaDrbLyPNC85249B+CiXqbXvfOAHDVkMwYqcxYUG+YZ5cpm
 U0OShLXm67dz8vT9cxqOSguCliPRlM9W5+EKzmVT7l8+ycds3BuEEHg1xWPrJWgG
 7XO10HkhZl+VvnJCj54KaszMUOdpvdEQSUs82gAFxjPbQIx5gosN9O0H+DnirMhS
 6VtzS20ZoIzjd4YVkRoLNcobHB4bZVTNXZ1Zi3C/neP9pxUjhOk0y+Vr/crC5Xph
 3TykIMgiVa+CdvQ/f4LOSiCgTFhF0tLGtfDQTG7f+9+W5pMc4NKSLi8EOMlJtYEy
 wsCYZ7/T9ElgrEzFvlxSvDwiPUhcldNao/EGdRYvMxXtgj0Ctw8LhR/2YKkqo6LK
 oMoKKWkj0o7uKSHKq+dakS0FprKnBnvE2Y+XA4SO/saPGFlDAVc=
 =OFJh
 -----END PGP SIGNATURE-----

BackMerge v4.19-rc5 into drm-next

Sean Paul requested an -rc5 backmerge from some sun4i fixes.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2018-09-27 11:06:46 +10:00
Hans de Goede beed1ce294 staging: vboxvideo: Add vbox_bo_k[un]map helper functions
Add vbox_bo_k[un]map helper functions instead of having code directly
poking struct vbox_bo internals.

While touch neighboring code anyways also fix a return -PTR_ERR(info),
which should be return PTR_ERR(info).

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-09-20 12:32:05 +02:00
Hans de Goede cfc1fc63be staging: vboxvideo: Move bo_[un]resere calls into vbox_bo_[un]pin
We always need to reserve the bo around a pin / unpin, so move the
reservation there.

This allows removing the vbox_fb_[un]pin helpers.

Note this means that we now no longer hold the bo reserved while
k[un]mapping it in vbox_fb.c this is fine as it is not necessary
to hold it reserved for this.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-09-20 12:32:05 +02:00
Hans de Goede 114094c83e staging: vboxvideo: Fix NULL ptr deref in vbox_set_up_input_mapping()
When vbox_set_up_input_mapping() gets called the first crtc might be
disable and not have a fb at all, triggering a NUL ptr deref at:

			vbox->input_mapping_width = CRTC_FB(crtci)->width;

Instead of using the fb from the crtc with id 0, just use the fb from
the first crtc with a fb. This is in the single_framebuffer = true path,
so all crtc-s point to the same fb anyways.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-09-20 12:32:05 +02:00
Hans de Goede 0fdda2ce74 staging: vboxvideo: Move pin / unpin of fb out of vbox_crtc_set_base_and_mode
Move pin / unpin of fb out of vbox_crtc_set_base_and_mode() so that it can
be used to implement the atomic_update drm_plane_helper_func for the primary
plane.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-09-20 12:32:05 +02:00
Hans de Goede 0424d7ba45 staging: vboxvideo: Init fb_info.fix.smem once from fbdev_create
The fbdev compat fb gets pinned into VRAM at creation and then gets pinned
a second time when set as scanout buffer and unpinned when replaced, this
means its pin count never becomes less then 1, so it is always at the same
address and there is no need for the vbox_fbdev_set_base() call.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-09-20 12:32:05 +02:00
Hans de Goede cb5eaf187d staging: vboxvideo: Expose creation of universal primary plane
Let's expose the primary plane initialization inside the vboxvideo driver
in preparation for universal planes and atomic.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-09-20 12:32:05 +02:00
Hans de Goede f4d6d90f83 staging: vboxvideo: Add fl_flag argument to vbox_fb_pin() helper
Allow specifying where to pin the framebuffer bo, so that this helper can
be used from the cursor code too.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-09-20 12:32:05 +02:00
Hans de Goede 3498ea8b7e staging: vboxvideo: Fold vbox_drm_resume() into vbox_pm_resume()
vbox_pm_resume() is the only caller of vbox_drm_resume(), so squash the
2 functions into 1.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-09-20 12:32:05 +02:00
Hans de Goede 01648890f3 staging: vboxvideo: Embed drm_device into driver structure
This is the recommended way to create the drm_device structure,
according to DRM documentation.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-09-20 12:32:05 +02:00
Hans de Goede d46709094d staging: vboxvideo: Fold driver_load/unload into probe/remove functions
Fold the driver_load / unload functions into the probe / remove functions
now that we are no longer using the deprecated drm_get_pci_dev() mechanism.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-09-20 12:32:05 +02:00
Hans de Goede 79815ee238 staging: vboxvideo: Move setup of modesetting from driver_load to mode_init
Move the setup of drm modesetting config from vbox_driver_load() to
vbox_mode_init().

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-09-20 12:32:05 +02:00