hyperv_drm.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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_simple_display_pipe pipe;
  12. struct drm_connector connector;
  13. /* mode */
  14. u32 screen_width_max;
  15. u32 screen_height_max;
  16. u32 preferred_width;
  17. u32 preferred_height;
  18. u32 screen_depth;
  19. /* hw */
  20. struct resource *mem;
  21. void __iomem *vram;
  22. unsigned long fb_base;
  23. unsigned long fb_size;
  24. struct completion wait;
  25. u32 synthvid_version;
  26. u32 mmio_megabytes;
  27. bool dirt_needed;
  28. u8 init_buf[VMBUS_MAX_PACKET_SIZE];
  29. u8 recv_buf[VMBUS_MAX_PACKET_SIZE];
  30. struct hv_device *hdev;
  31. };
  32. #define to_hv(_dev) container_of(_dev, struct hyperv_drm_device, dev)
  33. /* hyperv_drm_modeset */
  34. int hyperv_mode_config_init(struct hyperv_drm_device *hv);
  35. /* hyperv_drm_proto */
  36. int hyperv_update_vram_location(struct hv_device *hdev, phys_addr_t vram_pp);
  37. int hyperv_update_situation(struct hv_device *hdev, u8 active, u32 bpp,
  38. u32 w, u32 h, u32 pitch);
  39. int hyperv_hide_hw_ptr(struct hv_device *hdev);
  40. int hyperv_update_dirt(struct hv_device *hdev, struct drm_rect *rect);
  41. int hyperv_connect_vsp(struct hv_device *hdev);
  42. #endif