drm_sarea.h 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  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. /* SAREA area needs to be at least a page */
  34. #if defined(__alpha__)
  35. #define SAREA_MAX 0x2000U
  36. #elif defined(__ia64__)
  37. #define SAREA_MAX 0x10000U /* 64kB */
  38. #else
  39. /* Intel 830M driver needs at least 8k SAREA */
  40. #define SAREA_MAX 0x2000U
  41. #endif
  42. /** Maximum number of drawables in the SAREA */
  43. #define SAREA_MAX_DRAWABLES 256
  44. #define SAREA_DRAWABLE_CLAIMED_ENTRY 0x80000000
  45. /** SAREA drawable */
  46. struct drm_sarea_drawable {
  47. unsigned int stamp;
  48. unsigned int flags;
  49. };
  50. /** SAREA frame */
  51. struct drm_sarea_frame {
  52. unsigned int x;
  53. unsigned int y;
  54. unsigned int width;
  55. unsigned int height;
  56. unsigned int fullscreen;
  57. };
  58. /** SAREA */
  59. struct drm_sarea {
  60. /** first thing is always the DRM locking structure */
  61. struct drm_hw_lock lock;
  62. /** \todo Use readers/writer lock for drm_sarea::drawable_lock */
  63. struct drm_hw_lock drawable_lock;
  64. struct drm_sarea_drawable drawableTable[SAREA_MAX_DRAWABLES]; /**< drawables */
  65. struct drm_sarea_frame frame; /**< frame */
  66. drm_context_t dummy_context;
  67. };
  68. #ifndef __KERNEL__
  69. typedef struct drm_sarea_drawable drm_sarea_drawable_t;
  70. typedef struct drm_sarea_frame drm_sarea_frame_t;
  71. typedef struct drm_sarea drm_sarea_t;
  72. #endif
  73. #endif /* _DRM_SAREA_H_ */