drm/i915/gvt: Deliver guest cursor hotspot info
PATCH v5 1/1 drm/i915/gvt: Deliver guest cursor hotspot info
Guest OS driver uses PV info registers to deliver cursor hotspot info to host. This patch is used to get cursor hotspot info from virtual registers and deliver it to host userspace.
v4->v5:
- remove CI warning.
v3->v4:
- return UINT_MAX when x_hot/y_hot is invalid. (Zhenyu)
- correct version.
v2->v3:
- add validate_hotspot(). (Zhenyu)
v1->v2:
- name as cursor_x_hot/cursor_y_hot. (Zhenyu)
- use i915_reg_t definition instead of magic numbers. (Zhenyu)
--- drivers/gpu/drm/i915/gvt/dmabuf.c | 22 ++++++++++++++++------ drivers/gpu/drm/i915/gvt/fb_decoder.c | 3 +++ drivers/gpu/drm/i915/gvt/handlers.c | 4 ++-- drivers/gpu/drm/i915/gvt/vgpu.c | 3 +++ drivers/gpu/drm/i915/i915_pvinfo.h | 5 ++++- 5 files changed, 28 insertions(+), 9 deletions(-)
drivers/gpu/drm/i915/gvt/dmabuf.c +16 -6
@@ -192,6 +192,14 @@ static struct drm_i915_gem_object *vgpu_create_gem(struct drm_device *dev,return obj; } +static bool validate_hotspot (struct intel_vgpu_cursor_plane_format *c) +{ +if (c && c->x_hot <= c->width && c->y_hot <= c->height) +return true; +else +return false; +} + static int vgpu_get_plane_info(struct drm_device *dev, struct intel_vgpu *vgpu, struct intel_vgpu_fb_info *info,
@@ -229,12 +237,14 @@ static int vgpu_get_plane_info(struct drm_device *dev, info->x_pos = c.x_pos; info->y_pos = c.y_pos; -/* The invalid cursor hotspot value is delivered to host -* until we find a way to get the cursor hotspot info of -* guest OS. -*/ - info->x_hot =UINT_MAX ; - info->y_hot =UINT_MAX ; +if (validate_hotspot (&c)) { + info->x_hot = c.x_hot; + info->y_hot = c.y_hot; + }else { + info->x_hot =UINT_MAX ; + info->y_hot =UINT_MAX ; + } + info->size = (((info->stride * c.height * c.bpp) /8 ) + (PAGE_SIZE -1 )) >>PAGE_SHIFT ; }else {
drivers/gpu/drm/i915/gvt/fb_decoder.c +3 -0
@@ -36,6 +36,7 @@#include <uapi/drm/drm_fourcc.h> #include "i915_drv.h" #include "gvt.h" +#include "i915_pvinfo.h" #define PRIMARY_FORMAT_NUM 16struct pixel_format {
@@ -384,6 +385,8 @@ int intel_vgpu_decode_cursor_plane(struct intel_vgpu *vgpu, plane->y_pos = (val & _CURSOR_POS_Y_MASK) >> _CURSOR_POS_Y_SHIFT; plane->y_sign = (val & _CURSOR_SIGN_Y_MASK) >> _CURSOR_SIGN_Y_SHIFT; + plane->x_hot =vgpu_vreg_t (vgpu,vgtif_reg (cursor_x_hot)); + plane->y_hot =vgpu_vreg_t (vgpu,vgtif_reg (cursor_y_hot));return 0 ; }
drivers/gpu/drm/i915/gvt/handlers.c +2 -2
@@ -1209,8 +1209,8 @@ static int pvinfo_mmio_write(struct intel_vgpu *vgpu, unsigned int offset, ret =handle_g2v_notification (vgpu, data);break ;/* add xhot and yhot to handled list to avoid error log */ -case 0x78830 : -case 0x78834 : +case _vgtif_reg (cursor_x_hot): +case _vgtif_reg (cursor_y_hot):case _vgtif_reg (pdp[0 ].lo):case _vgtif_reg (pdp[0 ].hi):case _vgtif_reg (pdp[1 ].lo):
drivers/gpu/drm/i915/gvt/vgpu.c +3 -0
@@ -58,6 +58,9 @@ void populate_pvinfo_page(struct intel_vgpu *vgpu)vgpu_vreg_t (vgpu,vgtif_reg (avail_rs.fence_num)) =vgpu_fence_sz (vgpu); +vgpu_vreg_t (vgpu,vgtif_reg (cursor_x_hot)) =UINT_MAX ; +vgpu_vreg_t (vgpu,vgtif_reg (cursor_y_hot)) =UINT_MAX ; +gvt_dbg_core ("Populate PVINFO PAGE for vGPU %d\n" , vgpu->id);gvt_dbg_core ("aperture base [GMADR] 0x%llx size 0x%llx\n" ,vgpu_aperture_gmadr_base (vgpu),vgpu_aperture_sz (vgpu));
drivers/gpu/drm/i915/i915_pvinfo.h +4 -1
@@ -93,7 +93,10 @@ struct vgt_if {u32 rsv5[4 ];u32 g2v_notify; -u32 rsv6[7 ]; +u32 rsv6[5 ]; + +u32 cursor_x_hot; +u32 cursor_y_hot;struct {u32 lo;
Signature · 6 lines
2.7.4 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI✓ Fi.CI.BAT: success for drm/i915/gvt: Deliver guest cursor hotspot info (rev3)
== Series Details ==
== Series Details ==
Series: drm/i915/gvt: Deliver guest cursor hotspot info (rev3)
URL : https://patchwork.freedesktop.org/series/41727/
State : success
== Summary ==
= CI Bug Log - changes from CI_DRM_4172 -> Patchwork_8992 =
== Summary - WARNING ==
Minor unknown changes coming with Patchwork_8992 need to be verified manually.
If you think the reported changes have nothing to do with the changes introduced in Patchwork_8992, 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/41727/revisions/3/mbox/
== Possible new issues ==
Here are the unknown changes that may have been introduced in Patchwork_8992:
=== IGT changes ===
==== Warnings ====
igt@gem_exec_gttfill@basic:
fi-pnv-d510: SKIP -> PASS== Participating hosts (40 -> 36) ==
Missing (4): fi-byt-j1900 fi-ilk-m540 fi-byt-squawks fi-skl-6700hq
== Build changes ==
* Linux: CI_DRM_4172 -> Patchwork_8992
CI_DRM_4172: b4c14c0809e8f6dba9a4fdf1a659cea5a98750d3 @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_4475: 35f08c12aa216d5b62a5b9984b575cee6905098f @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
Patchwork_8992: ed94c7975cd1d2e3fe616059bc0ef242051c3312 @ git://anongit.freedesktop.org/gfx-ci/linux
piglit_4475: 3ba0657bff4216d1ec7179935590261855f1651e @ git://anongit.freedesktop.org/piglit
== Linux commits ==
ed94c7975cd1 drm/i915/gvt: Deliver guest cursor hotspot info
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_8992/issues.html
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI✓ Fi.CI.IGT: success for drm/i915/gvt: Deliver guest cursor hotspot info (rev3)
In reply to Tina Zhang== Series Details ==
== Series Details ==
Series: drm/i915/gvt: Deliver guest cursor hotspot info (rev3)
URL : https://patchwork.freedesktop.org/series/41727/
State : success
== Summary ==
= CI Bug Log - changes from CI_DRM_4172_full -> Patchwork_8992_full =
== Summary - WARNING ==
Minor unknown changes coming with Patchwork_8992_full need to be verified manually.
If you think the reported changes have nothing to do with the changes introduced in Patchwork_8992_full, 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/41727/revisions/3/mbox/
== Possible new issues ==
Here are the unknown changes that may have been introduced in Patchwork_8992_full:
=== IGT changes ===
==== Warnings ====
igt@gem_mocs_settings@mocs-rc6-bsd1:
shard-kbl: SKIP -> PASS
igt@gem_mocs_settings@mocs-rc6-vebox:
shard-kbl: PASS -> SKIP +1== Known issues ==
Here are the changes found in Patchwork_8992_full that come from known issues:
=== IGT changes ===
==== Issues hit ====
igt@kms_flip@flip-vs-expired-vblank-interruptible:
shard-glk: PASS -> FAIL (fdo#102887)
igt@kms_flip@plain-flip-fb-recreate-interruptible:
shard-glk: PASS -> FAIL (fdo#100368) +1
==== Possible fixes ====
igt@gem_ppgtt@blt-vs-render-ctxn:
shard-kbl: INCOMPLETE (fdo#106023, fdo#103665) -> PASS
igt@kms_atomic_transition@1x-modeset-transitions-nonblocking:
shard-apl: FAIL (fdo#103207, fdo#104724) -> PASS
igt@kms_flip@absolute-wf_vblank-interruptible:
shard-glk: FAIL (fdo#106087) -> PASS
igt@kms_flip@blocking-absolute-wf_vblank-interruptible:
shard-glk: FAIL (fdo#106134) -> PASS
igt@kms_setmode@basic:
shard-hsw: FAIL (fdo#99912) -> PASS
igt@kms_sysfs_edid_timing:
shard-apl: WARN (fdo#100047) -> PASS fdo#100047 https://bugs.freedesktop.org/show_bug.cgi?id=100047
fdo#100368 https://bugs.freedesktop.org/show_bug.cgi?id=100368
fdo#102887 https://bugs.freedesktop.org/show_bug.cgi?id=102887
fdo#103207 https://bugs.freedesktop.org/show_bug.cgi?id=103207
fdo#103665 https://bugs.freedesktop.org/show_bug.cgi?id=103665
fdo#104724 https://bugs.freedesktop.org/show_bug.cgi?id=104724
fdo#106023 https://bugs.freedesktop.org/show_bug.cgi?id=106023
fdo#106087 https://bugs.freedesktop.org/show_bug.cgi?id=106087
fdo#106134 https://bugs.freedesktop.org/show_bug.cgi?id=106134
fdo#99912 https://bugs.freedesktop.org/show_bug.cgi?id=99912
== Participating hosts (5 -> 5) ==
No changes in participating hosts
== Build changes ==
* Linux: CI_DRM_4172 -> Patchwork_8992
CI_DRM_4172: b4c14c0809e8f6dba9a4fdf1a659cea5a98750d3 @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_4475: 35f08c12aa216d5b62a5b9984b575cee6905098f @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
Patchwork_8992: ed94c7975cd1d2e3fe616059bc0ef242051c3312 @ git://anongit.freedesktop.org/gfx-ci/linux
piglit_4475: 3ba0657bff4216d1ec7179935590261855f1651e @ git://anongit.freedesktop.org/piglit
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_8992/shards.html
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx