drm_sarea.h 2.6 KB

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