Clone of mesa.
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

radeon_drm_bo.h 2.4KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. /*
  2. * Copyright © 2008 Jérôme Glisse
  3. * Copyright © 2011 Marek Olšák <maraeo@gmail.com>
  4. * All Rights Reserved.
  5. *
  6. * Permission is hereby granted, free of charge, to any person obtaining
  7. * a copy of this software and associated documentation files (the
  8. * "Software"), to deal in the Software without restriction, including
  9. * without limitation the rights to use, copy, modify, merge, publish,
  10. * distribute, sub license, and/or sell copies of the Software, and to
  11. * permit persons to whom the Software is furnished to do so, subject to
  12. * the following conditions:
  13. *
  14. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  15. * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
  16. * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
  17. * NON-INFRINGEMENT. IN NO EVENT SHALL THE COPYRIGHT HOLDERS, AUTHORS
  18. * AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  19. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
  20. * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
  21. * USE OR OTHER DEALINGS IN THE SOFTWARE.
  22. *
  23. * The above copyright notice and this permission notice (including the
  24. * next paragraph) shall be included in all copies or substantial portions
  25. * of the Software.
  26. */
  27. /*
  28. * Authors:
  29. * Jérôme Glisse <glisse@freedesktop.org>
  30. * Marek Olšák <maraeo@gmail.com>
  31. */
  32. #ifndef RADEON_DRM_BUFFER_H
  33. #define RADEON_DRM_BUFFER_H
  34. #include "radeon_winsys.h"
  35. #include "pipebuffer/pb_bufmgr.h"
  36. #include "os/os_thread.h"
  37. #define RADEON_PB_USAGE_CACHE (1 << 28)
  38. #define RADEON_PB_USAGE_DOMAIN_GTT (1 << 29)
  39. #define RADEON_PB_USAGE_DOMAIN_VRAM (1 << 30)
  40. struct radeon_bomgr;
  41. struct radeon_bo {
  42. struct pb_buffer base;
  43. struct radeon_bomgr *mgr;
  44. struct radeon_drm_winsys *rws;
  45. void *ptr;
  46. pipe_mutex map_mutex;
  47. uint32_t size;
  48. uint32_t handle;
  49. uint32_t name;
  50. int ref_count;
  51. /* how many command streams is this bo referenced in? */
  52. int num_cs_references;
  53. boolean flinked;
  54. uint32_t flink;
  55. };
  56. struct pb_manager *radeon_bomgr_create(struct radeon_drm_winsys *rws);
  57. void radeon_bomgr_init_functions(struct radeon_drm_winsys *ws);
  58. void radeon_bo_unref(struct radeon_bo *buf);
  59. static INLINE void radeon_bo_ref(struct radeon_bo *bo)
  60. {
  61. p_atomic_inc(&bo->ref_count);
  62. }
  63. static INLINE struct pb_buffer *
  64. pb_buffer(struct r300_winsys_bo *buffer)
  65. {
  66. return (struct pb_buffer *)buffer;
  67. }
  68. #endif