Skip to content

Commit 25bfa95

Browse files
committed
drm/hyperv: Handle feature change message from device
Virtual device inform if screen update is needed or not with SYNTHVID_FEATURE_CHANGE message. Handle this message to set dirt_needed flag. Suggested-by: Dexuan Cui <[email protected]> Signed-off-by: Deepak Rawat <[email protected]> Acked-by: Thomas Zimmermann <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent 76c56a5 commit 25bfa95

File tree

3 files changed

+10
-0
lines changed

3 files changed

+10
-0
lines changed

drivers/gpu/drm/hyperv/hyperv_drm.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ struct hyperv_drm_device {
2929
struct completion wait;
3030
u32 synthvid_version;
3131
u32 mmio_megabytes;
32+
bool dirt_needed;
3233

3334
u8 init_buf[VMBUS_MAX_PACKET_SIZE];
3435
u8 recv_buf[VMBUS_MAX_PACKET_SIZE];

drivers/gpu/drm/hyperv/hyperv_drm_drv.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,8 @@ static int hyperv_vmbus_probe(struct hv_device *hdev,
198198
if (ret)
199199
drm_warn(dev, "Failed to update vram location.\n");
200200

201+
hv->dirt_needed = true;
202+
201203
ret = hyperv_mode_config_init(hv);
202204
if (ret)
203205
goto err_vmbus_close;

drivers/gpu/drm/hyperv/hyperv_drm_proto.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -301,8 +301,12 @@ int hyperv_update_situation(struct hv_device *hdev, u8 active, u32 bpp,
301301

302302
int hyperv_update_dirt(struct hv_device *hdev, struct drm_rect *rect)
303303
{
304+
struct hyperv_drm_device *hv = hv_get_drvdata(hdev);
304305
struct synthvid_msg msg;
305306

307+
if (!hv->dirt_needed)
308+
return 0;
309+
306310
memset(&msg, 0, sizeof(struct synthvid_msg));
307311

308312
msg.vid_hdr.type = SYNTHVID_DIRT;
@@ -387,6 +391,9 @@ static void hyperv_receive_sub(struct hv_device *hdev)
387391
complete(&hv->wait);
388392
return;
389393
}
394+
395+
if (msg->vid_hdr.type == SYNTHVID_FEATURE_CHANGE)
396+
hv->dirt_needed = msg->feature_chg.is_dirt_needed;
390397
}
391398

392399
static void hyperv_receive(void *ctx)

0 commit comments

Comments
 (0)