hyperv_drm.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. * Copyright 2021 Microsoft
  4. */
  5. #ifndef _HYPERV_DRM_H_
  6. #define _HYPERV_DRM_H_
  7. #define VMBUS_MAX_PACKET_SIZE 0x4000
  8. struct hyperv_drm_device {
  9. /* drm */
  10. struct drm_device dev;
  11. struct drm_plane plane;
  12. struct drm_crtc crtc;
  13. struct drm_encoder encoder;
  14. struct drm_connector connector;
  15. /* mode */
  16. u32 screen_width_max;
  17. u32 screen_height_max;
  18. u32 preferred_width;
  19. u32 preferred_height;
  20. u32 screen_depth;
  21. /* hw */
  22. struct resource *mem;
  23. void __iomem *vram;
  24. unsigned long fb_base;
  25. unsigned long fb_size;
  26. struct completion wait;
  27. u32 synthvid_version;
  28. u32 mmio_megabytes;
  29. bool dirt_needed;
  30. u8 init_buf[VMBUS_MAX_PACKET_SIZE];
  31. u8 recv_buf[VMBUS_MAX_PACKET_SIZE];
  32. struct hv_device *hdev;
  33. };
  34. #define to_hv(_dev) container_of(_dev, struct hyperv_drm_device, dev)
  35. /* hyperv_drm_modeset */
  36. int hyperv_mode_config_init(struct hyperv_drm_device *hv);
  37. /* hyperv_drm_proto */
  38. int hyperv_update_vram_location(struct hv_device *hdev, phys_addr_t vram_pp);
  39. int hyperv_update_situation(struct hv_device *hdev, u8 active, u32 bpp,
  40. u32 w, u32 h, u32 pitch);
  41. int hyperv_hide_hw_ptr(struct hv_device *hdev);
  42. int hyperv_update_dirt(struct hv_device *hdev, struct drm_rect *rect);
  43. int hyperv_connect_vsp(struct hv_device *hdev);
  44. #endif