Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0-only */
0002 /*
0003  * Copyright 2021 Microsoft
0004  */
0005 
0006 #ifndef _HYPERV_DRM_H_
0007 #define _HYPERV_DRM_H_
0008 
0009 #define VMBUS_MAX_PACKET_SIZE 0x4000
0010 
0011 struct hyperv_drm_device {
0012     /* drm */
0013     struct drm_device dev;
0014     struct drm_simple_display_pipe pipe;
0015     struct drm_connector connector;
0016 
0017     /* mode */
0018     u32 screen_width_max;
0019     u32 screen_height_max;
0020     u32 preferred_width;
0021     u32 preferred_height;
0022     u32 screen_depth;
0023 
0024     /* hw */
0025     struct resource *mem;
0026     void __iomem *vram;
0027     unsigned long fb_base;
0028     unsigned long fb_size;
0029     struct completion wait;
0030     u32 synthvid_version;
0031     u32 mmio_megabytes;
0032     bool dirt_needed;
0033 
0034     u8 init_buf[VMBUS_MAX_PACKET_SIZE];
0035     u8 recv_buf[VMBUS_MAX_PACKET_SIZE];
0036 
0037     struct hv_device *hdev;
0038 };
0039 
0040 #define to_hv(_dev) container_of(_dev, struct hyperv_drm_device, dev)
0041 
0042 /* hyperv_drm_modeset */
0043 int hyperv_mode_config_init(struct hyperv_drm_device *hv);
0044 
0045 /* hyperv_drm_proto */
0046 int hyperv_update_vram_location(struct hv_device *hdev, phys_addr_t vram_pp);
0047 int hyperv_update_situation(struct hv_device *hdev, u8 active, u32 bpp,
0048                 u32 w, u32 h, u32 pitch);
0049 int hyperv_hide_hw_ptr(struct hv_device *hdev);
0050 int hyperv_update_dirt(struct hv_device *hdev, struct drm_rect *rect);
0051 int hyperv_connect_vsp(struct hv_device *hdev);
0052 
0053 #endif