drm_sarea.h 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. /**
  2. * \file drm_sarea.h
  3. * \brief SAREA definitions
  4. *
  5. * \author Michel Dänzer <michel@daenzer.net>
  6. */
  7. /*
  8. * Copyright 2002 Tungsten Graphics, Inc., Cedar Park, Texas.
  9. * All Rights Reserved.
  10. *
  11. * Permission is hereby granted, free of charge, to any person obtaining a
  12. * copy of this software and associated documentation files (the "Software"),
  13. * to deal in the Software without restriction, including without limitation
  14. * the rights to use, copy, modify, merge, publish, distribute, sublicense,
  15. * and/or sell copies of the Software, and to permit persons to whom the
  16. * Software is furnished to do so, subject to the following conditions:
  17. *
  18. * The above copyright notice and this permission notice (including the next
  19. * paragraph) shall be included in all copies or substantial portions of the
  20. * Software.
  21. *
  22. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  23. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  24. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
  25. * TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
  26. * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
  27. * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
  28. * OTHER DEALINGS IN THE SOFTWARE.
  29. */
  30. #ifndef _DRM_SAREA_H_
  31. #define _DRM_SAREA_H_
  32. #include "drm.h"
  33. #if defined(__cplusplus)
  34. extern "C" {
  35. #endif
  36. /* SAREA area needs to be at least a page */
  37. #if defined(__alpha__)
  38. #define SAREA_MAX 0x2000U
  39. #elif defined(__mips__)
  40. #define SAREA_MAX 0x4000U
  41. #elif defined(__ia64__)
  42. #define SAREA_MAX 0x10000U /* 64kB */
  43. #else
  44. /* Intel 830M driver needs at least 8k SAREA */
  45. #define SAREA_MAX 0x2000U
  46. #endif
  47. /** Maximum number of drawables in the SAREA */
  48. #define SAREA_MAX_DRAWABLES 256
  49. #define SAREA_DRAWABLE_CLAIMED_ENTRY 0x80000000
  50. /** SAREA drawable */
  51. struct drm_sarea_drawable {
  52. unsigned int stamp;
  53. unsigned int flags;
  54. };
  55. /** SAREA frame */
  56. struct drm_sarea_frame {
  57. unsigned int x;
  58. unsigned int y;
  59. unsigned int width;
  60. unsigned int height;
  61. unsigned int fullscreen;
  62. };
  63. /** SAREA */
  64. struct drm_sarea {
  65. /** first thing is always the DRM locking structure */
  66. struct drm_hw_lock lock;
  67. /** \todo Use readers/writer lock for drm_sarea::drawable_lock */
  68. struct drm_hw_lock drawable_lock;
  69. struct drm_sarea_drawable drawableTable[SAREA_MAX_DRAWABLES]; /**< drawables */
  70. struct drm_sarea_frame frame; /**< frame */
  71. drm_context_t dummy_context;
  72. };
  73. typedef struct drm_sarea_drawable drm_sarea_drawable_t;
  74. typedef struct drm_sarea_frame drm_sarea_frame_t;
  75. typedef struct drm_sarea drm_sarea_t;
  76. #if defined(__cplusplus)
  77. }
  78. #endif
  79. #endif /* _DRM_SAREA_H_ */