| 1 |
|
| 2 | |
| 3 | * Copyright 2021 Microsoft
|
| 4 |
|
| 5 |
|
| 6 | #ifndef _HYPERV_DRM_H_
|
| 7 | #define _HYPERV_DRM_H_
|
| 8 |
|
| 9 | #define VMBUS_MAX_PACKET_SIZE 0x4000
|
| 10 |
|
| 11 | struct hv_drm_device {
|
| 12 |
|
| 13 | struct drm_device dev;
|
| 14 | struct drm_plane plane;
|
| 15 | struct drm_crtc crtc;
|
| 16 | struct drm_encoder encoder;
|
| 17 | struct drm_connector connector;
|
| 18 |
|
| 19 |
|
| 20 | u32 screen_width_max;
|
| 21 | u32 screen_height_max;
|
| 22 | u32 preferred_width;
|
| 23 | u32 preferred_height;
|
| 24 | u32 screen_depth;
|
| 25 |
|
| 26 |
|
| 27 | struct resource *mem;
|
| 28 | void __iomem *vram;
|
| 29 | unsigned long fb_base;
|
| 30 | unsigned long fb_size;
|
| 31 | struct completion wait;
|
| 32 | u32 synthvid_version;
|
| 33 | u32 mmio_megabytes;
|
| 34 | bool dirt_needed;
|
| 35 |
|
| 36 | u8 init_buf[VMBUS_MAX_PACKET_SIZE];
|
| 37 | u8 recv_buf[VMBUS_MAX_PACKET_SIZE];
|
| 38 |
|
| 39 | struct hv_device *hdev;
|
| 40 | };
|
| 41 |
|
| 42 | #define to_hv_drm(_dev) container_of(_dev, struct hv_drm_device, dev)
|
| 43 |
|
| 44 |
|
| 45 | int hv_drm_mode_config_init(struct hv_drm_device *hv);
|
| 46 |
|
| 47 |
|
| 48 | int hv_drm_update_vram_location(struct hv_device *hdev, phys_addr_t vram_pp);
|
| 49 | int hv_drm_update_situation(struct hv_device *hdev, u8 active, u32 bpp,
|
| 50 | u32 w, u32 h, u32 pitch);
|
| 51 | int hv_drm_hide_hw_ptr(struct hv_device *hdev);
|
| 52 | int hv_drm_update_dirt(struct hv_device *hdev, struct drm_rect *rect);
|
| 53 | int hv_drm_connect_vsp(struct hv_device *hdev);
|
| 54 |
|
| 55 | #endif
|