- Jun 28, 2017
-
-
Laurent Pinchart authored
The CRTC helper .commit() operation is legacy code, the atomic helpers prefer the .enable() operation. Replace the .commit() helper operation with .enable() in the driver. Signed-off-by:
Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Signed-off-by:
Daniel Vetter <daniel.vetter@ffwll.ch> Link: http://patchwork.freedesktop.org/patch/msgid/20170627211621.27767-6-laurent.pinchart+renesas@ideasonboard.com
-
Laurent Pinchart authored
The CRTC .prepare() helper operation is part of the legacy helpers and is deprecated in favour of the .disable() helper operation. As the vmwgfx driver provides a .disable() helper operation, and as the .prepare() helper operation implementation is empty, we can remove it. Signed-off-by:
Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Signed-off-by:
Daniel Vetter <daniel.vetter@ffwll.ch> Link: http://patchwork.freedesktop.org/patch/msgid/20170627211621.27767-5-laurent.pinchart+renesas@ideasonboard.com
-
- Jun 27, 2017
-
-
Simona Vetter authored
Again stopping the vblank before uninstalling the irq handler is kinda the wrong way round, but the fb_off stuff should take care of disabling the dsiplay at least in most cases. So drop the drm_vblank_cleanup code since it's not really doing anything, it looks all cargo-culted. v2: Appease gcc better. v3: Simplify code (Sean Paul) Cc: Sinclair Yeh <syeh@vmware.com> Cc: Thomas Hellstrom <thellstrom@vmware.com> Reviewed-by:
Sean Paul <seanpaul@chromium.org> Reviewed-by:
Thomas Hellstrom <thellstrom@vmware.com> Signed-off-by:
Daniel Vetter <daniel.vetter@intel.com> Link: http://patchwork.freedesktop.org/patch/msgid/20170626161949.25629-1-daniel.vetter@ffwll.ch
-
- Jun 20, 2017
-
-
Simona Vetter authored
The magic switching between proper pci driver and shadow-attach isn't useful anymore since there's no ums+kms drivers left. Let's split this up properly, calling pci_register_driver for kms drivers and renaming the shadow-attach init to drm_legacy_pci_init/exit. 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-6-daniel.vetter@ffwll.ch
-
Simona Vetter authored
The only special-case is pci devices, and we can easily handle this in the core. Do so and drop a pile of boilerplate from drivers. 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-5-daniel.vetter@ffwll.ch
-
- Jun 07, 2017
-
-
Thomas Hellstrom authored
While the atomic modesetting capability is signaled also elsewhere, also reflect it by a driver minor bump. Signed-off-by:
Thomas Hellstrom <thellstrom@vmware.com>
-
Sinclair Yeh authored
These function implementations and/or declarations are no longer used now that atomic is enabled. Signed-off-by:
Sinclair Yeh <syeh@vmware.com> Reported-by:
Daniel Vetter <daniel@ffwll.ch> Reviewed-by:
Thomas Hellstrom <thellstrom@vmware.com>
-
Colin Ian King authored
Trivial fix to spelling mistake in DRM_ERROR error message. Signed-off-by:
Colin Ian King <colin.king@canonical.com> Reviewed-by:
Sinclair Yeh <syeh@vmware.com>
-
Sinclair Yeh authored
The previous attempt at this had an issue with with num_clips > 1 because it would always end up using the coordinates of the last clip while using width and height calculated from the bounding box of all the clips. So if the last clip happens to be not at the top-left corner of the bounding box, the CPU blit operation would go out of bounds. The original intent was to coalesce all the clips into one blit, and to do that we need to also track the starting point of the content buffer. Signed-off-by:
Sinclair Yeh <syeh@vmware.com> Reviewed-by:
Thomas Hellstrom <thellstrom@vmware.com>
-
Sinclair Yeh authored
When a new FB is bound, we have to send an update command otherwise the new FB may not be shown Signed-off-by:
Sinclair Yeh <syeh@vmware.com> Reviewed-by:
Thomas Hellstrom <thellstrom@vmware.com>
-
Sinclair Yeh authored
When vmw_gb_surface_define_ioctl() is called with an existing buffer, we end up returning an uninitialized variable in the backup_handle. The fix is to first initialize backup_handle to 0 just to be sure, and second, when a user-provided buffer is found, we will use the req->buffer_handle as the backup_handle. Cc: <stable@vger.kernel.org> Reported-by:
Murray McAllister <murray.mcallister@insomniasec.com> Signed-off-by:
Sinclair Yeh <syeh@vmware.com> Reviewed-by:
Deepak Rawat <drawat@vmware.com>
-
Dan Carpenter authored
If vmalloc() fails then we need to a bit of cleanup before returning. Cc: <stable@vger.kernel.org> Fixes: fb1d9738 ("drm/vmwgfx: Add DRM driver for VMware Virtual GPU") Signed-off-by:
Dan Carpenter <dan.carpenter@oracle.com> Reviewed-by:
Sinclair Yeh <syeh@vmware.com>
-
Sinclair Yeh authored
With atomic, the cursor surface is treated like a FB. Creating a proxy surface for cursor doesn't gain us much benefit. This fixes the issue on atomic enabled 2D VMs where the cursor disappears. Signed-off-by:
Sinclair Yeh <syeh@vmware.com> Reviewed-by:
Thomas Hellstrom <thellstrom@vmware.com>
-
Vladis Dronov authored
The 'req->mip_levels' parameter in vmw_gb_surface_define_ioctl() is a user-controlled 'uint32_t' value which is used as a loop count limit. This can lead to a kernel lockup and DoS. Add check for 'req->mip_levels'. References: https://bugzilla.redhat.com/show_bug.cgi?id=1437431 Cc: <stable@vger.kernel.org> Signed-off-by:
Vladis Dronov <vdronov@redhat.com> Reviewed-by:
Sinclair Yeh <syeh@vmware.com>
-
- May 22, 2017
-
-
Robert Foss authored
Add DRM_MODE_ROTATE_ and DRM_MODE_REFLECT_ defines to the UAPI as a convenience. Ideally the DRM_ROTATE_ and DRM_REFLECT_ property ids are looked up through the atomic API, but realizing that userspace is likely to take shortcuts and assume that the enum values are what is sent over the wire. As a result these defines are provided purely as a convenience to userspace applications. Changes since v3: - Switched away from past tense in comments - Add define name change to previously mis-spelled DRM_REFLECT_X comment - Improved the comment for the DRM_MODE_REFLECT_<axis> comment Changes since v2: - Changed define prefix from DRM_MODE_PROP_ to DRM_MODE_ - Fix compilation errors - Changed comment formatting - Deduplicated comment lines - Clarified DRM_MODE_PROP_REFLECT_ comment Changes since v1: - Moved defines from drm.h to drm_mode.h - Changed define prefix from DRM_ to DRM_MODE_PROP_ - Updated uses of the defines to the new prefix - Removed include from drm_rect.c - Stopped using the BIT() macro Signed-off-by:
Robert Foss <robert.foss@collabora.com> Reviewed-by:
Emil Velikov <emil.velikov@collabora.com> Reviewed-by:
Sinclair Yeh <syeh@vmware.com> Acked-by:
Liviu Dudau <Liviu.Dudau@arm.com> Signed-off-by:
Daniel Vetter <daniel.vetter@ffwll.ch> Link: http://patchwork.freedesktop.org/patch/msgid/20170519205017.23307-2-robert.foss@collabora.com
-
- May 18, 2017
-
-
Masahiro Yamada authored
Include <drm/*.h> instead of relative path from include/drm, then remove the -Iinclude/drm compiler flag. Signed-off-by:
Masahiro Yamada <yamada.masahiro@socionext.com> Signed-off-by:
Daniel Vetter <daniel.vetter@ffwll.ch> Link: http://patchwork.freedesktop.org/patch/msgid/1493009447-31524-18-git-send-email-yamada.masahiro@socionext.com
-
- Apr 21, 2017
-
-
Øyvind A. Holm authored
Change "S_IRUSR | S_IWUSR" to "0600", it's easier to parse mentally. This change should be part of commit 50f83737 ("drm/vmwgfx: Revert "drm/vmwgfx: Replace numeric parameter like 0444 with macro""), but the patch was truncated somewhere in the patch route, so add the missing change. Extract from the original commit message: commit 50f83737 Author: Øyvind A. Holm <sunny@sunbase.org> Date: Thu Mar 23 14:54:48 2017 -0700 drm/vmwgfx: Revert "drm/vmwgfx: Replace numeric parameter like 0444 with macro" This reverts commit 2d8e60e8 ("drm/vmwgfx: Replace numeric parameter like 0444 with macro") The commit belongs to the series of 1285 patches sent to LKML on 2016-08-02, it changes the representation of file permissions from the octal value "0600" to "S_IRUSR | S_IWUSR". The general consensus was that the changes does not increase readability, quite the opposite; 0600 is easier to parse mentally than S_IRUSR | S_IWUSR. Signed-off-by:
Øyvind A. Holm <sunny@sunbase.org> Reviewed-by:
Sinclair Yeh <syeh@vmware.com>
-
- Apr 20, 2017
-
-
Logan Gunthorpe authored
Seeing the kunmap_atomic dma_buf_ops share the same name with a macro in highmem.h, the former can be aliased if any dma-buf user includes that header. I'm personally trying to include highmem.h inside scatterlist.h and this breaks the dma-buf code proper. Christoph Hellwig suggested [1] renaming it and pushing this patch ASAP. To maintain consistency I've renamed all four of kmap* and kunmap* to be map* and unmap*. (Even though only kmap_atomic presently conflicts.) [1] https://www.spinics.net/lists/target-devel/msg15070.html Signed-off-by:
Logan Gunthorpe <logang@deltatee.com> Reviewed-by:
Sinclair Yeh <syeh@vmware.com> Acked-by:
Daniel Vetter <daniel.vetter@ffwll.ch> Acked-by:
Sumit Semwal <sumit.semwal@linaro.org> Signed-off-by:
Sumit Semwal <sumit.semwal@linaro.org> Link: http://patchwork.freedesktop.org/patch/msgid/1492630570-879-1-git-send-email-logang@deltatee.com
-
- Apr 07, 2017
-
-
Simona Vetter authored
I've broken this by removing the backoff handling from the set_config2atomic helper in commit 38b6441e Author: Daniel Vetter <daniel.vetter@ffwll.ch> Date: Wed Mar 22 22:50:58 2017 +0100 drm/atomic-helper: Remove the backoff hack from set_config Fixing this properly would mean we get to wire the acquire_ctx all the way through vmwgfx fbdev code, and doing the same was tricky for the shared fbdev layer. Probably much better to look into refactoring the entire code to use the helpers, but since that's not a viable long-term solution fix the issue by open-coding a vmwgfx version of set_config, that does the legacy backoff dance internally. Note: Just compile-tested. The idea is to take drm_mode_set_config_internal(), remove the "is this a legacy driver" check, and whack the drm_atomic_legacy_backoff trickery at the end. Since drm_atomic_legacy_backoff is for atomic commits only we need to open-code it. Cc: Thomas Hellstrom <thellstrom@vmware.com> Signed-off-by:
Daniel Vetter <daniel.vetter@intel.com> Reviewed-by:
Thomas Hellstrom <thellstrom@vmware.com> Signed-off-by:
Sean Paul <seanpaul@chromium.org> Link: http://patchwork.freedesktop.org/patch/msgid/20170406200256.26040-1-daniel.vetter@ffwll.ch
-
- Apr 06, 2017
-
-
Simona Vetter authored
Atomic helpers really want this instead of the hacked-up legacy backoff trick, which unfortunately prevents drivers from using their own private drm_modeset_locks. Aside: There's a few atomic drivers (nv50, vc4, soon vmwgfx) which don't yet use the new atomic color mgmt/gamma table stuff. Would be nice if they could switch over and just hook up drm_atomic_helper_legacy_gamma_set() instead. Cc: Dave Airlie <airlied@redhat.com> Cc: Alex Deucher <alexander.deucher@amd.com> Cc: Christian König <christian.koenig@amd.com> Cc: Gerd Hoffmann <kraxel@redhat.com> Cc: Ben Skeggs <bskeggs@redhat.com> Cc: Sinclair Yeh <syeh@vmware.com> Cc: Thomas Hellstrom <thellstrom@vmware.com> Cc: Eric Anholt <eric@anholt.net> Reviewed-by:
Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Acked-by:
Alex Deucher <alexander.deucher@amd.com> Reviewed-by:
Sinclair Yeh <syeh@vmware.com> Signed-off-by:
Daniel Vetter <daniel.vetter@intel.com> Link: http://patchwork.freedesktop.org/patch/msgid/20170403083304.9083-13-daniel.vetter@ffwll.ch
-
- Apr 05, 2017
-
-
Christian König authored
This allows the driver to handle io_mem mappings on their own. Signed-off-by:
Christian König <christian.koenig@amd.com> Reviewed-by:
Michel Dänzer <michel.daenzer@amd.com> Reviewed-by:
Nicolai Hähnle <nicolai.haehnle@amd.com> Signed-off-by:
Alex Deucher <alexander.deucher@amd.com>
-
- Mar 31, 2017
-
-
Sinclair Yeh authored
The scanout surface size is the smaller of max texture size and max STDU size. Signed-off-by:
Sinclair Yeh <syeh@vmware.com> Reviewed-by:
Thomas Hellstrom <thellstrom@vmware.com>
-
Sinclair Yeh authored
Most of the display servers today use a single surface to represent the entire desktop even if it's stretched across multiple screens. For vmwgfx with STDU, the maximum surface size is limited to the maximum texture size on the host. On a 2D VM, this limits our ability to support configurations with more than one 4K monitor. To get past this limitation, we will now allow using a large DMA buf as the framebuffer, and take care of blitting contents from this DMA buf to the display buffer. Signed-off-by:
Sinclair Yeh <syeh@vmware.com> Reviewed-by:
Thomas Hellstrom <thellstrom@vmware.com>
-
Thomas Hellstrom authored
Provide and document a reference implementation. Signed-off-by:
Thomas Hellstrom <thellstrom@vmware.com> Reviewed-by:
Sinclair Yeh <syeh@vmware.com>
-
Thomas Hellstrom authored
The callbacks we need to provide to many resources are very similar, so provide a simple resource type with a number of helpers for these callbacks. Signed-off-by:
Thomas Hellstrom <thellstrom@vmware.com> Reviewed-by:
Sinclair Yeh <syeh@vmware.com>
-
Øyvind A. Holm authored
This reverts commit 2d8e60e8 ("drm/vmwgfx: Replace numeric parameter like 0444 with macro") The commit belongs to the series of 1285 patches sent to LKML on 2016-08-02, it changes the representation of file permissions from the octal value "0600" to "S_IRUSR | S_IWUSR". The general consensus was that the changes does not increase readability, quite the opposite; 0600 is easier to parse mentally than S_IRUSR | S_IWUSR. It also causes argument inconsistency, due to commit 04319d89 ("drm/vmwgfx: Add an option to change assumed FB bpp") that added another call to module_param_named() where the permissions are written as 0600. Signed-off-by:
Øyvind A. Holm <sunny@sunbase.org> Reviewed-by:
Sinclair Yeh <syeh@vmware.com>
-
Sinclair Yeh authored
vmw_ldu_crtc_helper_commit() is not called if drm_atomic_crtc_needs_modeset() decides nothing related to CRTC timing has changed. So a better place for this code is in vmw_ldu_primary_plane_atomic_update() since we will need to update ld->fb every time the FB is updated. Signed-off-by:
Sinclair Yeh <syeh@vmware.com> Reviewed-by:
Thomas Hellstrom <thellstrom@vmware.com>
-
Sinclair Yeh authored
Pinning fbdev's FB at the start of VRAM prevents X from pinning its FB. Since for ldu, the fb would be pinned anyway during a mode set, just skip pinning it in fbdev. This is not the best solution, but since ldu is not used much anymore, it seems like a reasonable workaround. Signed-off-by:
Sinclair Yeh <syeh@vmware.com> Reviewed-by:
Thomas Hellstrom <thellstrom@vmware.com>
-
Sinclair Yeh authored
We can no longer make the assumption that vmw_stdu_update_st() will be called when there's a valid display surface attached. So instead of using display_srf for width and height, make a record of these paremeters when the screen target is first defined. Signed-off-by:
Sinclair Yeh <syeh@vmware.com> Reviewed-by:
Thomas Hellstrom <thellstrom@vmware.com>
-
Sinclair Yeh authored
Now that the legacy path has been tested, turn on the DRIVER_ATOMIC flag so user mode driver can start going through the Atomic path. Signed-off-by:
Sinclair Yeh <syeh@vmware.com> Reviewed-by:
Thomas Hellstrom <thellstrom@vmware.com> Acked-by:
Daniel Vetter <daniel@ffwll.ch>
-
Sinclair Yeh authored
Switch over to internal atomic API. This completes the atomic internal atomic switch for all the Display Units. Signed-off-by:
Sinclair Yeh <syeh@vmware.com> Signed-off-by:
Thomas Hellstrom <thellstrom@vmware.com> Reviewed-by:
Thomas Hellstrom <thellstrom@vmware.com>
-
Sinclair Yeh authored
Switch over to using internal atomic API for mode set. This removes the legacy set_config API, replacing it with drm_atomic_helper_set_config(). The DRM helper will use various vmwgfx-specific atomic functions to set a mode. DRIVER_ATOMIC capability flag is not yet set, so the user mode will still use the legacy mode set IOCTL. v2: * Avoid a clash between page-flip pinning and setcrtc pinning, modify the page-flip code to use the page-flip helper and the atomic callbacks. To enable this, we will need to add a wrapper around atomic_commit. * Add vmw_kms_set_config() to work around vmwgfx xorg driver bug Signed-off-by:
Sinclair Yeh <syeh@vmware.com> Signed-off-by:
Thomas Hellstrom <thellstrom@vmware.com> Reviewed-by:
Thomas Hellstrom <thellstrom@vmware.com>
-
Sinclair Yeh authored
1. When unsetting a mode, num_connector should be set to zero 2. The pixel_format field needs to be initialized as newer DRM internal functions checks this field 3. Take the drm_modeset_lock_all() because vmw_fb_kms_detach() can change current mode Signed-off-by:
Sinclair Yeh <syeh@vmware.com> Reviewed-by:
Thomas Hellstrom <thellstrom@vmware.com>
-
Sinclair Yeh authored
This connects the main state object check and commit function. v2 * Use drm_atomic_helper_commit() rather than a vmwgfx-specific one Signed-off-by:
Sinclair Yeh <syeh@vmware.com> Signed-off-by:
Thomas Hellstrom <thellstrom@vmware.com> Reviewed-by:
Thomas Hellstrom <thellstrom@vmware.com> Acked-by:
Daniel Vetter <daniel@ffwll.ch>
-
Sinclair Yeh authored
These helpers won't be called until we flip on the atomic support flag or set drm_crtc_funcs->set_config to using the atomic helper. v2 Use drm_atomic_helper_best_encoder() rather than a vmwgfx-specific one Signed-off-by:
Sinclair Yeh <syeh@vmware.com> Reviewed-by:
Thomas Hellstrom <thellstrom@vmware.com> Acked-by:
Daniel Vetter <daniel@ffwll.ch>
-
Sinclair Yeh authored
Refactor previous FB and cursor plane update code into their atomic counterparts: check, update, prepare, cleanup, and disable. These helpers won't be called until we flip on the atomic support flag or set drm_crtc_funcs->set_config to using the atomic helper. v2: * Removed unnecessary pinning of cursor surface * Added a few function headers v3: * Set clip region equal to the destination region * Fixed surface pinning policy * Enable SVGA mode in vmw_sou_primary_plane_prepare_fb Signed-off-by:
Sinclair Yeh <syeh@vmware.com> Signed-off-by:
Thomas Hellstrom <thellstrom@vmware.com> Reviewed-by:
Thomas Hellstrom <thellstrom@vmware.com>
-
Sinclair Yeh authored
Atomic mode set requires us to refactor existing vmw_stdu_crtc_set_config code into sections that check the validity of the new mode, and sections that actually program the hardware state. vmw_du_crtc_atomic_check() takes CRTC-related checking code. In a later patch, vmw_du_primary_plane_atomic_check() will take framebuffer-related checking code. These helpers won't be called until we flip on the atomic support flag or set drm_crtc_funcs->set_config to using the atomic helper. v2: * The state->num_connector is actually the total number of potential connectors, not just the one associated with the display unit. The proper one to check is ->connector_mask. * Add the check to only allow plane state to be the same as crtc state (Thanks to mlankhorst) * Make sure to turn on SVGA mode before using VRAM. SVGA mode is disabled in master_drop if dbdev is not running. v3: * Moved dot clock override to crtc_atomic_check Signed-off-by:
Sinclair Yeh <syeh@vmware.com> Signed-off-by:
Thomas Hellstrom <thellstrom@vmware.com> Reviewed-by:
Thomas Hellstrom <thellstrom@vmware.com> Acked-by:
Daniel Vetter <daniel@ffwll.ch>
-
Sinclair Yeh authored
Add connector handling functions. Start tracking is_implicity in the connector state. Eventually, this field should be tracked exclusively in a connector state. Now that plane and connector states have been created, we can also activate the code that use CRTC state. Signed-off-by:
Sinclair Yeh <syeh@vmware.com> Reviewed-by:
Thomas Hellstrom <thellstrom@vmware.com>
-
Sinclair Yeh authored
Add plane state handling functions. We have to keep track of a few plane states so we cannot use the DRM helper for this. Created vmw_plane_state along with functions to reset, duplicate, and destroty it. v2 * Removed cursor clean up special case Signed-off-by:
Sinclair Yeh <syeh@vmware.com> Reviewed-by:
Thomas Hellstrom <thellstrom@vmware.com> Acked-by:
Daniel Vetter <daniel@ffwll.ch>
-
Sinclair Yeh authored
Create and Add CRTC state. We currently do not track any properties or custom states so we can technically use the DRM helpers. Creating this code just to make potential future additions easier. Most of the new code will be compiled but not enabled until plane/connector state handling code is also in place. This is the first of a series to enable atomic mode set for vmwgfx. The atomic enabling effort was done in collaboration with Thomas Hellstrom and the VMware Graphics Team. Signed-off-by:
Sinclair Yeh <syeh@vmware.com> Reviewed-by:
Thomas Hellstrom <thellstrom@vmware.com>
-