vmwgfx_vkms.h 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. /* SPDX-License-Identifier: GPL-2.0 OR MIT */
  2. /**************************************************************************
  3. *
  4. * Copyright (c) 2024 Broadcom. All Rights Reserved. The term
  5. * “Broadcom” refers to Broadcom Inc. and/or its subsidiaries.
  6. *
  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:
  14. *
  15. * The above copyright notice and this permission notice (including the
  16. * next paragraph) shall be included in all copies or substantial portions
  17. * of the Software.
  18. *
  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.
  26. *
  27. **************************************************************************/
  28. #ifndef VMWGFX_VKMS_H_
  29. #define VMWGFX_VKMS_H_
  30. #include <linux/hrtimer_types.h>
  31. #include <linux/types.h>
  32. struct drm_atomic_state;
  33. struct drm_crtc;
  34. struct vmw_private;
  35. struct vmw_surface;
  36. void vmw_vkms_init(struct vmw_private *vmw);
  37. void vmw_vkms_cleanup(struct vmw_private *vmw);
  38. void vmw_vkms_modeset_lock(struct drm_crtc *crtc);
  39. bool vmw_vkms_modeset_lock_relaxed(struct drm_crtc *crtc);
  40. bool vmw_vkms_vblank_trylock(struct drm_crtc *crtc);
  41. void vmw_vkms_unlock(struct drm_crtc *crtc);
  42. bool vmw_vkms_get_vblank_timestamp(struct drm_crtc *crtc,
  43. int *max_error,
  44. ktime_t *vblank_time,
  45. bool in_vblank_irq);
  46. int vmw_vkms_enable_vblank(struct drm_crtc *crtc);
  47. void vmw_vkms_disable_vblank(struct drm_crtc *crtc);
  48. void vmw_vkms_crtc_init(struct drm_crtc *crtc);
  49. void vmw_vkms_crtc_cleanup(struct drm_crtc *crtc);
  50. void vmw_vkms_crtc_atomic_begin(struct drm_crtc *crtc,
  51. struct drm_atomic_state *state);
  52. void vmw_vkms_crtc_atomic_flush(struct drm_crtc *crtc, struct drm_atomic_state *state);
  53. void vmw_vkms_crtc_atomic_enable(struct drm_crtc *crtc,
  54. struct drm_atomic_state *state);
  55. void vmw_vkms_crtc_atomic_disable(struct drm_crtc *crtc,
  56. struct drm_atomic_state *state);
  57. const char *const *vmw_vkms_get_crc_sources(struct drm_crtc *crtc,
  58. size_t *count);
  59. int vmw_vkms_verify_crc_source(struct drm_crtc *crtc,
  60. const char *src_name,
  61. size_t *values_cnt);
  62. int vmw_vkms_set_crc_source(struct drm_crtc *crtc,
  63. const char *src_name);
  64. void vmw_vkms_set_crc_surface(struct drm_crtc *crtc,
  65. struct vmw_surface *surf);
  66. #endif