1 /* SPDX-License-Identifier: GPL-2.0 OR MIT */
2 /**************************************************************************
4 * Copyright (c) 2024 Broadcom. All Rights Reserved. The term
5 * “Broadcom” refers to Broadcom Inc. and/or its subsidiaries.
7 * Permission is hereby granted, free of charge, to any person obtaining a
8 * copy of this software and associated documentation files (the
9 * "Software"), to deal in the Software without restriction, including
10 * without limitation the rights to use, copy, modify, merge, publish,
11 * distribute, sub license, and/or sell copies of the Software, and to
12 * permit persons to whom the Software is furnished to do so, subject to
13 * the following conditions:
15 * The above copyright notice and this permission notice (including the
16 * next paragraph) shall be included in all copies or substantial portions
19 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
22 * THE COPYRIGHT HOLDERS, AUTHORS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM,
23 * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
24 * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
25 * USE OR OTHER DEALINGS IN THE SOFTWARE.
27 **************************************************************************/
29 #ifndef VMWGFX_VKMS_H_
30 #define VMWGFX_VKMS_H_
32 #include <linux/hrtimer_types.h>
33 #include <linux/types.h>
35 struct drm_atomic_state;
40 void vmw_vkms_init(struct vmw_private *vmw);
41 void vmw_vkms_cleanup(struct vmw_private *vmw);
43 void vmw_vkms_modeset_lock(struct drm_crtc *crtc);
44 bool vmw_vkms_modeset_lock_relaxed(struct drm_crtc *crtc);
45 bool vmw_vkms_vblank_trylock(struct drm_crtc *crtc);
46 void vmw_vkms_unlock(struct drm_crtc *crtc);
48 bool vmw_vkms_get_vblank_timestamp(struct drm_crtc *crtc,
52 int vmw_vkms_enable_vblank(struct drm_crtc *crtc);
53 void vmw_vkms_disable_vblank(struct drm_crtc *crtc);
55 void vmw_vkms_crtc_init(struct drm_crtc *crtc);
56 void vmw_vkms_crtc_cleanup(struct drm_crtc *crtc);
57 void vmw_vkms_crtc_atomic_begin(struct drm_crtc *crtc,
58 struct drm_atomic_state *state);
59 void vmw_vkms_crtc_atomic_flush(struct drm_crtc *crtc, struct drm_atomic_state *state);
60 void vmw_vkms_crtc_atomic_enable(struct drm_crtc *crtc,
61 struct drm_atomic_state *state);
62 void vmw_vkms_crtc_atomic_disable(struct drm_crtc *crtc,
63 struct drm_atomic_state *state);
65 const char *const *vmw_vkms_get_crc_sources(struct drm_crtc *crtc,
67 int vmw_vkms_verify_crc_source(struct drm_crtc *crtc,
70 int vmw_vkms_set_crc_source(struct drm_crtc *crtc,
71 const char *src_name);
72 void vmw_vkms_set_crc_surface(struct drm_crtc *crtc,
73 struct vmw_surface *surf);