Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 <decui@microsoft.com>
Signed-off-by: Deepak Rawat <drawat.floss@gmail.com>
Acked-by: Thomas Zimmermann <tzimmermann@suse.de>
Link: https://patchwork.freedesktop.org/patch/msgid/20210527112230.1274-2-drawat.floss@gmail.com

+10
+1
drivers/gpu/drm/hyperv/hyperv_drm.h
··· 29 29 struct completion wait; 30 30 u32 synthvid_version; 31 31 u32 mmio_megabytes; 32 + bool dirt_needed; 32 33 33 34 u8 init_buf[VMBUS_MAX_PACKET_SIZE]; 34 35 u8 recv_buf[VMBUS_MAX_PACKET_SIZE];
+2
drivers/gpu/drm/hyperv/hyperv_drm_drv.c
··· 198 198 if (ret) 199 199 drm_warn(dev, "Failed to update vram location.\n"); 200 200 201 + hv->dirt_needed = true; 202 + 201 203 ret = hyperv_mode_config_init(hv); 202 204 if (ret) 203 205 goto err_vmbus_close;
+7
drivers/gpu/drm/hyperv/hyperv_drm_proto.c
··· 301 301 302 302 int hyperv_update_dirt(struct hv_device *hdev, struct drm_rect *rect) 303 303 { 304 + struct hyperv_drm_device *hv = hv_get_drvdata(hdev); 304 305 struct synthvid_msg msg; 306 + 307 + if (!hv->dirt_needed) 308 + return 0; 305 309 306 310 memset(&msg, 0, sizeof(struct synthvid_msg)); 307 311 ··· 391 387 complete(&hv->wait); 392 388 return; 393 389 } 390 + 391 + if (msg->vid_hdr.type == SYNTHVID_FEATURE_CHANGE) 392 + hv->dirt_needed = msg->feature_chg.is_dirt_needed; 394 393 } 395 394 396 395 static void hyperv_receive(void *ctx)