1 /**************************************************************************
3 * Copyright © 2009 VMware, Inc., Palo Alto, CA., USA
6 * Permission is hereby granted, free of charge, to any person obtaining a
7 * copy of this software and associated documentation files (the
8 * "Software"), to deal in the Software without restriction, including
9 * without limitation the rights to use, copy, modify, merge, publish,
10 * distribute, sub license, and/or sell copies of the Software, and to
11 * permit persons to whom the Software is furnished to do so, subject to
12 * the following conditions:
14 * The above copyright notice and this permission notice (including the
15 * next paragraph) shall be included in all copies or substantial portions
18 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20 * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
21 * THE COPYRIGHT HOLDERS, AUTHORS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM,
22 * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
23 * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
24 * USE OR OTHER DEALINGS IN THE SOFTWARE.
26 **************************************************************************/
32 #include "drm_crtc_helper.h"
33 #include "vmwgfx_drv.h"
35 #define VMWGFX_NUM_DISPLAY_UNITS 8
38 #define vmw_framebuffer_to_vfb(x) \
39 container_of(x, struct vmw_framebuffer, base)
42 * Base class for framebuffers
44 * @pin is called the when ever a crtc uses this framebuffer
47 struct vmw_framebuffer
{
48 struct drm_framebuffer base
;
49 int (*pin
)(struct vmw_framebuffer
*fb
);
50 int (*unpin
)(struct vmw_framebuffer
*fb
);
52 struct ttm_base_object
*user_obj
;
57 #define vmw_crtc_to_du(x) \
58 container_of(x, struct vmw_display_unit, crtc)
61 * Basic cursor manipulation
63 int vmw_cursor_update_image(struct vmw_private
*dev_priv
,
64 u32
*image
, u32 width
, u32 height
,
65 u32 hotspotX
, u32 hotspotY
);
66 void vmw_cursor_update_position(struct vmw_private
*dev_priv
,
67 bool show
, int x
, int y
);
70 * Base class display unit.
72 * Since the SVGA hw doesn't have a concept of a crtc, encoder or connector
73 * so the display unit is all of them at the same time. This is true for both
74 * legacy multimon and screen objects.
76 struct vmw_display_unit
{
78 struct drm_encoder encoder
;
79 struct drm_connector connector
;
81 struct vmw_surface
*cursor_surface
;
82 struct vmw_dma_buffer
*cursor_dmabuf
;
94 * Prefered mode tracking.
99 struct drm_display_mode
*pref_mode
;
109 #define vmw_crtc_to_du(x) \
110 container_of(x, struct vmw_display_unit, crtc)
111 #define vmw_connector_to_du(x) \
112 container_of(x, struct vmw_display_unit, connector)
116 * Shared display unit functions - vmwgfx_kms.c
118 void vmw_display_unit_cleanup(struct vmw_display_unit
*du
);
119 void vmw_du_crtc_save(struct drm_crtc
*crtc
);
120 void vmw_du_crtc_restore(struct drm_crtc
*crtc
);
121 void vmw_du_crtc_gamma_set(struct drm_crtc
*crtc
,
122 u16
*r
, u16
*g
, u16
*b
,
123 uint32_t start
, uint32_t size
);
124 int vmw_du_crtc_cursor_set(struct drm_crtc
*crtc
, struct drm_file
*file_priv
,
125 uint32_t handle
, uint32_t width
, uint32_t height
);
126 int vmw_du_crtc_cursor_move(struct drm_crtc
*crtc
, int x
, int y
);
127 void vmw_du_connector_dpms(struct drm_connector
*connector
, int mode
);
128 void vmw_du_connector_save(struct drm_connector
*connector
);
129 void vmw_du_connector_restore(struct drm_connector
*connector
);
130 enum drm_connector_status
131 vmw_du_connector_detect(struct drm_connector
*connector
, bool force
);
132 int vmw_du_connector_fill_modes(struct drm_connector
*connector
,
133 uint32_t max_width
, uint32_t max_height
);
134 int vmw_du_connector_set_property(struct drm_connector
*connector
,
135 struct drm_property
*property
,
140 * Legacy display unit functions - vmwgfx_ldu.c
142 int vmw_kms_init_legacy_display_system(struct vmw_private
*dev_priv
);
143 int vmw_kms_close_legacy_display_system(struct vmw_private
*dev_priv
);
146 * Screen Objects display functions - vmwgfx_scrn.c
148 int vmw_kms_init_screen_object_display(struct vmw_private
*dev_priv
);
149 int vmw_kms_close_screen_object_display(struct vmw_private
*dev_priv
);
150 int vmw_kms_sou_update_layout(struct vmw_private
*dev_priv
, unsigned num
,
151 struct drm_vmw_rect
*rects
);
This page took 0.034771 seconds and 5 git commands to generate.