vmwgfx as a new driver for igt-gpu-tools
cover vmwgfx as a new driver for igt-gpu-tools
Hi,
With this patch series adding vmwgfx as new driver for igt-gpu-tools and some changes to make kms_atomic test case work for vmwgfx. For now the main motivation for this was page-flip with damage test case to test the new plane property FB_DAMAGE_CLIPS. However, will be adding more vmwgfx specific tests in future.
Thanks,
Deepak
Deepak Rawat (5):
lib/igt_vmwgfx: Add vmwgfx device
lib/igt_fb: Call dumb_destroy ioctl in case of dumb buffers tests/kms: Don't check crtc state for vmwgfx legacy set_crtc lib/igt_fb: Check for stride before creating cairo surface tests/kms_atomic: Add a new test case for FB_DAMAGE_CLIPS plane
property
lib/drmtest.c | 9 +- lib/drmtest.h | 3 + lib/igt_fb.c | 8 +- lib/igt_kms.c | 16 +++ lib/igt_kms.h | 2 + tests/kms_atomic.c | 267 ++++++++++++++++++++++++++++++++++++++++++++- 6 files changed, 302 insertions(+), 3 deletions(-)
Signature · 6 lines
2.17.1 _______________________________________________ igt-dev mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/igt-dev
PATCH 1/5 lib/igt_vmwgfx: Add vmwgfx device
Add DRIVER_VMWGFX to represent vmwgfx device for running igt tests.
--- lib/drmtest.c | 9 ++++++++- lib/drmtest.h | 3 +++ 2 files changed, 11 insertions(+), 1 deletion(-)
lib/drmtest.c +8 -1
@@ -105,6 +105,11 @@ bool is_i915_device(int fd)return __is_device (fd,"i915" ); } +bool is_vmwgfx_device (int fd) +{ +return __is_device (fd,"vmwg" ); +} +static bool has_known_intel_chipset (int fd) {struct drm_i915_getparam gp;
@@ -205,7 +210,7 @@ static const struct module { { DRIVER_VC4, "vc4" }, { DRIVER_VGEM, "vgem" }, { DRIVER_VIRTIO, "virtio-gpu" }, - { DRIVER_VIRTIO, "virtio_gpu" }, + { DRIVER_VMWGFX, "vmwgfx" }, {} };
@@ -335,6 +340,8 @@ static const char *chipset_to_str(int chipset)return "virtio" ;case DRIVER_AMDGPU :return "amdgpu" ; +case DRIVER_VMWGFX : +return "vmwgfx" ;case DRIVER_ANY :return "any" ;default :
lib/drmtest.h +3 -0
@@ -43,6 +43,7 @@#define DRIVER_VGEM (1 << 2)#define DRIVER_VIRTIO (1 << 3)#define DRIVER_AMDGPU (1 << 4) +#define DRIVER_VMWGFX (1 << 5)/* * Exclude DRVER_VGEM from DRIVER_ANY since if you run on a system * with vgem as well as a supported driver, you can end up with a
@@ -80,6 +81,8 @@ void igt_require_intel(int fd);bool is_i915_device (int fd); +bool is_vmwgfx_device (int fd); +/** * do_or_die: * @x: command
Signature · 6 lines
2.17.1 _______________________________________________ igt-dev mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/igt-dev
Re: [igt-dev] [PATCH i-g-t 1/5] lib/igt_vmwgfx: Add vmwgfx device
Quoted 25 lines · Deepak Rawat
Add
DRIVER_VMWGFXto represent vmwgfx device for running igt tests.Signed-off-by Deepak Rawat <[email protected]>--- lib/drmtest.c | 9 ++++++++- lib/drmtest.h | 3 +++ 2 files changed, 11 insertions(+), 1 deletion(-)lib/drmtest.c +5
-0@@ -105,6 +105,11 @@ bool is_i915_device(int fd)return __is_device (fd,"i915" ); } +bool is_vmwgfx_device (int fd) +{ +return __is_device (fd,"vmwg" ); +} +static bool has_known_intel_chipset (int fd) {struct drm_i915_getparam gp;
lib/drmtest.c static const struct module { · line 214
Quoted 6 lines
lib/drmtest.c +1
-1@@ -205,7 +210,7 @@ static const struct module { { DRIVER_VC4, "vc4" }, { DRIVER_VGEM, "vgem" }, { DRIVER_VIRTIO, "virtio-gpu" }, - { DRIVER_VIRTIO, "virtio_gpu" }, + { DRIVER_VMWGFX, "vmwgfx" }, {}
Don't remove the second virtio-gpu line, there's a reason for it.
.... we should probably add a comment there.
Signature · 5 lines
Petri Latvala _______________________________________________ igt-dev mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/igt-dev
Re: [igt-dev] [Intel-gfx] [PATCH i-g-t 1/5] lib/igt_vmwgfx: Add vmwgfx device
Quoted 36 lines · Petri Latvala
Quoted 25 lines · Deepak Rawat
Add
DRIVER_VMWGFXto represent vmwgfx device for running igt tests.Signed-off-by Deepak Rawat <[email protected]>--- lib/drmtest.c | 9 ++++++++- lib/drmtest.h | 3 +++ 2 files changed, 11 insertions(+), 1 deletion(-)lib/drmtest.c +5
-0@@ -105,6 +105,11 @@ bool is_i915_device(int fd)return __is_device (fd,"i915" ); } +bool is_vmwgfx_device (int fd) +{ +return __is_device (fd,"vmwg" ); +} +static bool has_known_intel_chipset (int fd) {struct drm_i915_getparam gp;lib/drmtest.c static const struct module { · line 214
Quoted 6 lines
lib/drmtest.c +1
-1@@ -205,7 +210,7 @@ static const struct module { { DRIVER_VC4, "vc4" }, { DRIVER_VGEM, "vgem" }, { DRIVER_VIRTIO, "virtio-gpu" }, - { DRIVER_VIRTIO, "virtio_gpu" }, + { DRIVER_VMWGFX, "vmwgfx" }, {}Don't remove the second virtio-gpu line, there's a reason for it.
Quoted 1 line
.... we should probably add a comment there.
Don't keep us in suspense!
Jani.
Signature · 5 lines
Jani Nikula, Intel Open Source Graphics Center _______________________________________________ igt-dev mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/igt-dev
PATCH 2/5 lib/igt_fb: Call dumb_destroy ioctl in case of dumb buffers
In reply to Deepak Rawatvmwgfx does not support GEM interface so calling gem_close on vmwgfx results in error. Call dumb destroy IOCTL in case have dumb buffer.
--- lib/igt_fb.c | 5 ++++- lib/igt_kms.c | 15 +++++++++++++++ lib/igt_kms.h | 1 + 3 files changed, 20 insertions(+), 1 deletion(-)
lib/igt_fb.c +4 -1
@@ -1920,7 +1920,10 @@ void igt_remove_fb(int fd, struct igt_fb *fb)cairo_surface_destroy (fb->cairo_surface);do_or_die (drmModeRmFB (fd, fb->fb_id)); -gem_close (fd, fb->gem_handle); +if (fb->is_dumb) +kmstest_dumb_destroy (fd, fb->gem_handle); +else +gem_close (fd, fb->gem_handle); fb->fb_id =0 ; }
lib/igt_kms.c +15 -0
@@ -639,6 +639,21 @@ void *kmstest_dumb_map_buffer(int fd, uint32_t handle, uint64_t size,return ptr; } +/** +* kmstest_dumb_destroy: +* @fd: Opened drm file descriptor +* @handle: Offset in the file referred to by fd +*/ +void kmstest_dumb_destroy (int fd,uint32_t handle) +{ +struct drm_mode_destroy_dumb arg = {}; + +igt_assert_neq (handle,0 ); + + arg.handle = handle; +do_ioctl (fd,DRM_IOCTL_MODE_DESTROY_DUMB , &arg); +} +/* * Returns: the previous mode, or KD_GRAPHICS if no /dev/tty0 was * found and nothing was done.
lib/igt_kms.h +1 -0
@@ -222,6 +222,7 @@ uint32_t kmstest_dumb_create(int fd, int width, int height, int bpp,void *kmstest_dumb_map_buffer (int fd,uint32_t handle,uint64_t size,unsigned prot); +void kmstest_dumb_destroy (int fd,uint32_t handle);void kmstest_wait_for_pageflip (int fd);unsigned int kmstest_get_vblank (int fd,int pipe,unsigned int flags);void igt_assert_plane_visible (int fd,enum pipe pipe,bool visibility);
Signature · 6 lines
2.17.1 _______________________________________________ igt-dev mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/igt-dev
Re: [igt-dev] [PATCH i-g-t 2/5] lib/igt_fb: Call dumb_destroy ioctl in case of dumb buffers
Quoting Deepak Rawat (2018-09-06 01:03:47)
Quoted 34 lines
vmwgfx does not support GEM interface so calling
gem_closeon vmwgfx results in error. Call dumb destroy IOCTL in case have dumb buffer.Signed-off-by Deepak Rawat <[email protected]>--- lib/igt_fb.c | 5 ++++- lib/igt_kms.c | 15 +++++++++++++++ lib/igt_kms.h | 1 + 3 files changed, 20 insertions(+), 1 deletion(-)lib/igt_fb.c +4
-1@@ -1920,7 +1920,10 @@ void igt_remove_fb(int fd, struct igt_fb *fb)cairo_surface_destroy (fb->cairo_surface);do_or_die (drmModeRmFB (fd, fb->fb_id)); -gem_close (fd, fb->gem_handle); +if (fb->is_dumb) +kmstest_dumb_destroy (fd, fb->gem_handle); +else +gem_close (fd, fb->gem_handle); fb->fb_id =0 ; }lib/igt_kms.c +0
-0@@ -639,6 +639,21 @@ void *kmstest_dumb_map_buffer(int fd, uint32_t handle, uint64_t size,return ptr; }
lib/igt_kms.c void *kmstest_dumb_map_buffer(int fd, uint32_t handle, uint64_t size, · line 651
Quoted 10 lines
lib/igt_kms.c +10
-0+/** +* kmstest_dumb_destroy: +* @fd: Opened drm file descriptor +* @handle: Offset in the file referred to by fd +*/ +void kmstest_dumb_destroy (int fd,uint32_t handle) +{ +struct drm_mode_destroy_dumb arg = {}; + +igt_assert_neq (handle,0 );
Don't bother doing the kernel's job for it. Abusing the ioctl iface is the name of the game.
lib/igt_kms.c void *kmstest_dumb_map_buffer(int fd, uint32_t handle, uint64_t size, · line 654
Quoted 2 lines
lib/igt_kms.c +2
-0+ arg.handle = handle; +do_ioctl (fd,DRM_IOCTL_MODE_DESTROY_DUMB , &arg);
struct drm_mode_destroy_dumb arg = { handle };
Try never to use do_ioctl() if you ever want to debug an error. -Chris
_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev
PATCH 3/5 tests/kms: Don't check crtc state for vmwgfx legacy set_crtc
In reply to Deepak RawatFor a Xorg bug vmwgfx has a kernel workaround which reset the value of mode::type. This will cause crtc state not to match what is expected.
--- tests/kms_atomic.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
tests/kms_atomic.c +6 -1
@@ -237,7 +237,12 @@ static void crtc_commit(igt_pipe_t *pipe, igt_plane_t *plane, {igt_display_commit2 (pipe->display, s); -crtc_check_current_state (pipe, pipe->values, plane->values, relax); +/* +* For a vmwgfx xorg driver bug kernel module reset the value of +* mode::type so crtc state check fails for legacy commit +*/ +if (!is_vmwgfx_device (pipe->display->drm_fd) || !(s ==COMMIT_LEGACY )) +crtc_check_current_state (pipe, pipe->values, plane->values, relax);plane_check_current_state (plane, plane->values, relax); }
Signature · 6 lines
2.17.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [Intel-gfx] [igt-dev] [PATCH i-g-t 3/5] tests/kms: Don't check crtc state for vmwgfx legacy set_crtc
Quoting Deepak Rawat (2018-09-06 01:03:48)
Quoted 2 lines
For a Xorg bug vmwgfx has a kernel workaround which reset the value of
mode::type. This will cause crtc state not to match what is expected.
Seems suspect, I think we need a stronger reason to accept iface irregularities.
-Chris
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 4/5 lib/igt_fb: Check for stride before creating cairo surface
In reply to Deepak RawatCairo surface creation will fail if stride of provided buffer is not same as expected by cairo. This fails for vmwgfx odd length framebuffer as in vmwgfx stride is always width * bpp.
--- lib/igt_fb.c | 3 +++ 1 file changed, 3 insertions(+)
lib/igt_fb.c +3 -0
@@ -1349,6 +1349,9 @@ static void create_cairo_surface__gtt(int fd, struct igt_fb *fb) ptr =gem_mmap__gtt (fd, fb->gem_handle, fb->size,PROT_READ |PROT_WRITE ); +igt_require (fb->stride ==cairo_format_stride_for_width ( +drm_format_to_cairo (fb->drm_format), fb->width)); + fb->cairo_surface = cairo_image_surface_create_for_data(ptr, drm_format_to_cairo(fb->drm_format),
Signature · 6 lines
2.17.1 _______________________________________________ igt-dev mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/igt-dev
Re: [igt-dev] [Intel-gfx] [PATCH i-g-t 4/5] lib/igt_fb: Check for stride before creating cairo surface
Quoting Deepak Rawat (2018-09-06 01:03:49)
Quoted 14 lines
Cairo surface creation will fail if stride of provided buffer is not same as expected by cairo. This fails for vmwgfx odd length framebuffer as in vmwgfx stride is always width * bpp.
Signed-off-by Deepak Rawat <[email protected]>--- lib/igt_fb.c | 3 +++ 1 file changed, 3 insertions(+)lib/igt_fb.c +0
-0
lib/igt_fb.c static void create_cairo_surface__gtt(int fd, struct igt_fb *fb) · line 1357
Quoted 9 lines
lib/igt_fb.c +3
-0@@ -1349,6 +1349,9 @@ static void create_cairo_surface__gtt(int fd, struct igt_fb *fb) ptr =gem_mmap__gtt (fd, fb->gem_handle, fb->size,PROT_READ |PROT_WRITE ); +igt_require (fb->stride ==cairo_format_stride_for_width ( +drm_format_to_cairo (fb->drm_format), fb->width)); + fb->cairo_surface = cairo_image_surface_create_for_data(ptr, drm_format_to_cairo(fb->drm_format),
Is there not a
igt_require_f/igt_assert_f(cairo_surface_status(fb->cairo_surface) == CAIRO_STATUS_SUCCESS, "Unable to create a cairo surface: %s", cairo_status_to_string(cairo_surface_status(fb->cairo_surface))); here?
-Chris
_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev
Re: [igt-dev] [Intel-gfx] [PATCH i-g-t 4/5] lib/igt_fb: Check for stride before creating cairo surface
Quoted 26 lines
Quoting Deepak Rawat (2018-09-06 01:03:49)
lib/igt_fb.c static void create_cairo_surface__gtt(int fd,
Quoted 14 lines
Cairo surface creation will fail if stride of provided buffer is not same as expected by cairo. This fails for vmwgfx odd length framebuffer as in vmwgfx stride is always width * bpp.
Signed-off-by Deepak Rawat <[email protected]>--- lib/igt_fb.c | 3 +++ 1 file changed, 3 insertions(+)lib/igt_fb.c +0
-0@@ -1349,6 +1349,9 @@ static void create_cairo_surface__gtt(int fd,struct
igt_fb*fb)lib/igt_fb.c static void create_cairo_surface__gtt(int fd, struct igt_fb *fb) · line 1357
Quoted 9 lines
lib/igt_fb.c +3
-0ptr =gem_mmap__gtt (fd, fb->gem_handle, fb->size,PROT_READ |PROT_WRITE ); +igt_require (fb->stride ==cairo_format_stride_for_width ( +drm_format_to_cairo (fb->drm_format), fb->width)); + fb->cairo_surface = cairo_image_surface_create_for_data(ptr, drm_format_to_cairo(fb->drm_format),
Quoted 7 lines
Is there not a igt_require_f/igt_assert_f(cairo_surface_status(fb->cairo_surface) ==
CAIRO_STATUS_SUCCESS,
"Unable to create a cairo surface: %s", cairo_status_to_string(cairo_surface_status(fb->cairo_surface))); here?
-Chris
Thanks Chris for the review.
No there wasn't a check like that but I guess I can add that instead of checking for stride.
_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev
PATCH 5/5 tests/kms_atomic: Add a new test case for FB_DAMAGE_CLIPS plane property
In reply to Deepak RawatSome simple test cases to use FB_DAMAGE_CLIPS plane property.
--- lib/igt_kms.c | 1 + lib/igt_kms.h | 1 + tests/kms_atomic.c | 260 +++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 262 insertions(+)
lib/igt_kms.c +1 -0
@@ -175,6 +175,7 @@ const char * const igt_plane_prop_names[IGT_NUM_PLANE_PROPS] = { [IGT_PLANE_IN_FORMATS] = "IN_FORMATS", [IGT_PLANE_COLOR_ENCODING] = "COLOR_ENCODING", [IGT_PLANE_COLOR_RANGE] = "COLOR_RANGE", + [IGT_PLANE_FB_DAMAGE_CLIPS] = "FB_DAMAGE_CLIPS", };const char *const igt_crtc_prop_names[IGT_NUM_CRTC_PROPS ] = {
lib/igt_kms.h +1 -0
@@ -267,6 +267,7 @@ enum igt_atomic_plane_properties {IGT_PLANE_IN_FORMATS ,IGT_PLANE_COLOR_ENCODING ,IGT_PLANE_COLOR_RANGE , +IGT_PLANE_FB_DAMAGE_CLIPS , IGT_NUM_PLANE_PROPS };
tests/kms_atomic.c +260 -0
278 lines not on this page · raw message
Signature · 6 lines
2.17.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI[igt-dev] ✓ Fi.CI.BAT: success for vmwgfx as a new driver for igt-gpu-tools
In reply to Deepak Rawat== Series Details ==
== Series Details ==
Series: vmwgfx as a new driver for igt-gpu-tools
URL : https://patchwork.freedesktop.org/series/49239/
State : success
== Summary ==
= CI Bug Log - changes from CI_DRM_4775 -> IGTPW_1801 =
== Summary - WARNING ==
Minor unknown changes coming with IGTPW_1801 need to be verified manually.
If you think the reported changes have nothing to do with the changes introduced in IGTPW_1801, please notify your bug team to allow them to document this new failure mode, which will reduce false positives in CI.
External URL: https://patchwork.freedesktop.org/api/1.0/series/49239/revisions/1/mbox/
== Possible new issues ==
Here are the unknown changes that may have been introduced in IGTPW_1801:
=== IGT changes ===
==== Warnings ====
igt@kms_busy@basic-flip-a:
fi-byt-n2820: PASS -> SKIP +1
fi-bdw-gvtdvm: PASS -> SKIP +2
fi-ivb-3520m: PASS -> SKIP +2
igt@kms_busy@basic-flip-b:
fi-skl-gvtdvm: PASS -> SKIP +2
fi-ilk-650: PASS -> SKIP
fi-kbl-7500u: PASS -> SKIP
igt@kms_cursor_legacy@basic-flip-before-cursor-atomic:
fi-snb-2520m: PASS -> SKIP +27
igt@kms_flip@basic-flip-vs-wf_vblank:
fi-hsw-peppy: PASS -> SKIP +36
igt@kms_pipe_crc_basic@nonblocking-crc-pipe-b:
fi-bsw-kefka: PASS -> SKIP +30
igt@kms_pipe_crc_basic@read-crc-pipe-b:
fi-byt-clapper: PASS -> SKIP +29
igt@kms_psr@sprite_plane_onoff:
fi-skl-6700hq: PASS -> SKIP
fi-kbl-7560u: PASS -> SKIP
fi-skl-6600u: PASS -> SKIP
igt@pm_rpm@module-reload:
fi-hsw-4770r: PASS -> SKIP== Known issues ==
Here are the changes found in IGTPW_1801 that come from known issues:
=== IGT changes ===
==== Issues hit ====
igt@drv_module_reload@basic-reload:
fi-glk-j4005: PASS -> DMESG-WARN (fdo#106725, fdo#106248)
igt@drv_module_reload@basic-reload-inject:
fi-hsw-4770r: PASS -> DMESG-WARN (fdo#107425)
igt@kms_psr@primary_page_flip:
fi-bdw-samus: PASS -> FAIL (fdo#107336)
==== Possible fixes ====
igt@kms_frontbuffer_tracking@basic:
fi-byt-clapper: FAIL (fdo#103167) -> PASS
igt@kms_pipe_crc_basic@suspend-read-crc-pipe-b:
fi-byt-clapper: FAIL (fdo#107362, fdo#103191) -> SKIP
igt@kms_psr@cursor_plane_move:
fi-cnl-psr: FAIL (fdo#107717) -> PASS
igt@kms_psr@primary_page_flip:
fi-cnl-psr: FAIL (fdo#107336) -> PASS
igt@kms_psr@sprite_plane_onoff:
fi-icl-u: FAIL (fdo#107383) -> SKIP
igt@pm_rpm@module-reload:
fi-hsw-peppy: DMESG-WARN (fdo#107603) -> SKIP fdo#103167 https://bugs.freedesktop.org/show_bug.cgi?id=103167
fdo#103191 https://bugs.freedesktop.org/show_bug.cgi?id=103191
fdo#106248 https://bugs.freedesktop.org/show_bug.cgi?id=106248
fdo#106725 https://bugs.freedesktop.org/show_bug.cgi?id=106725
fdo#107336 https://bugs.freedesktop.org/show_bug.cgi?id=107336
fdo#107362 https://bugs.freedesktop.org/show_bug.cgi?id=107362
fdo#107383 https://bugs.freedesktop.org/show_bug.cgi?id=107383
fdo#107425 https://bugs.freedesktop.org/show_bug.cgi?id=107425
fdo#107603 https://bugs.freedesktop.org/show_bug.cgi?id=107603
fdo#107717 https://bugs.freedesktop.org/show_bug.cgi?id=107717
== Participating hosts (54 -> 48) ==
Missing (6): fi-ilk-m540 fi-hsw-4200u fi-byt-j1900 fi-byt-squawks fi-bsw-cyan fi-ctg-p8600
== Build changes ==
* IGT: IGT_4630 -> IGTPW_1801
CI_DRM_4775: 1a2bb6c061217718b972b3f4a74b96b61cf19d0c @ git://anongit.freedesktop.org/gfx-ci/linux
IGTPW_1801: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_1801/
IGT_4630: 86686c6e2f7c6f0944bced11550e06d20bc6957f @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
== Testlist changes ==
+igt@kms_atomic@atomic_plane_damage
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_1801/issues.html
_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev