summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c
diff options
context:
space:
mode:
authorZack Rusin <zack.rusin@broadcom.com>2024-04-11 22:55:07 -0400
committerZack Rusin <zack.rusin@broadcom.com>2024-04-15 13:32:18 -0400
commitcd2eb57df1b8bbac90daad622b2f1ef00640c38c (patch)
tree3c833c4ee7afaa845175776844f60e171874fe53 /drivers/gpu/drm/vmwgfx/vmwgfx_kms.c
parentbfc7bc539392f681194de341dd2bb9e83f31f588 (diff)
downloadlinux-cd2eb57df1b8bbac90daad622b2f1ef00640c38c.tar.gz
linux-cd2eb57df1b8bbac90daad622b2f1ef00640c38c.tar.bz2
linux-cd2eb57df1b8bbac90daad622b2f1ef00640c38c.zip
drm/vmwgfx: Implement virtual kms
By default vmwgfx doesn't support vblanking or crc generation which makes it impossible to use various IGT tests to validate vmwgfx. Implement virtual kernel mode setting, which is mainly related to simulated vblank support. Code is very similar to amd's vkms and the vkms module itself, except that it's integrated with vmwgfx three different output technologies - legacy, screen object and screen targets. Make IGT's kms_vblank pass on vmwgfx and allows a lot of other IGT tests to run with vmwgfx. Support for vkms needs to be manually enabled by adding: guestinfo.vmwgfx.vkms_enable = "TRUE" somewhere in the vmx file, otherwise it's off by default. Signed-off-by: Zack Rusin <zack.rusin@broadcom.com> Acked-by: Martin Krastev <martin.krastev@broadcom.com> Link: https://patchwork.freedesktop.org/patch/msgid/20240412025511.78553-2-zack.rusin@broadcom.com
Diffstat (limited to 'drivers/gpu/drm/vmwgfx/vmwgfx_kms.c')
-rw-r--r--drivers/gpu/drm/vmwgfx/vmwgfx_kms.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c b/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c
index 09214f9339b2..e763cf0e6cfc 100644
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c
@@ -27,6 +27,7 @@
#include "vmwgfx_kms.h"
#include "vmwgfx_bo.h"
+#include "vmwgfx_vkms.h"
#include "vmw_surface_cache.h"
#include <drm/drm_atomic.h>
@@ -37,9 +38,16 @@
#include <drm/drm_sysfs.h>
#include <drm/drm_edid.h>
+void vmw_du_init(struct vmw_display_unit *du)
+{
+ hrtimer_init(&du->vkms.timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
+ du->vkms.timer.function = &vmw_vkms_vblank_simulate;
+}
+
void vmw_du_cleanup(struct vmw_display_unit *du)
{
struct vmw_private *dev_priv = vmw_priv(du->primary.dev);
+ hrtimer_cancel(&du->vkms.timer);
drm_plane_cleanup(&du->primary);
if (vmw_cmd_supported(dev_priv))
drm_plane_cleanup(&du->cursor.base);
@@ -957,13 +965,6 @@ void vmw_du_crtc_atomic_begin(struct drm_crtc *crtc,
{
}
-
-void vmw_du_crtc_atomic_flush(struct drm_crtc *crtc,
- struct drm_atomic_state *state)
-{
-}
-
-
/**
* vmw_du_crtc_duplicate_state - duplicate crtc state
* @crtc: DRM crtc