omap_drmif.h 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. /*
  2. * Copyright (C) 2011 Texas Instruments, Inc
  3. *
  4. * Permission is hereby granted, free of charge, to any person obtaining a
  5. * copy of this software and associated documentation files (the "Software"),
  6. * to deal in the Software without restriction, including without limitation
  7. * the rights to use, copy, modify, merge, publish, distribute, sublicense,
  8. * and/or sell copies of the Software, and to permit persons to whom the
  9. * Software is furnished to do so, subject to the following conditions:
  10. *
  11. * The above copyright notice and this permission notice (including the next
  12. * paragraph) shall be included in all copies or substantial portions of the
  13. * Software.
  14. *
  15. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  16. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  17. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
  18. * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  19. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  20. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  21. * SOFTWARE.
  22. *
  23. * Authors:
  24. * Rob Clark <rob@ti.com>
  25. */
  26. #ifndef OMAP_DRMIF_H_
  27. #define OMAP_DRMIF_H_
  28. #include <xf86drm.h>
  29. #include <stdint.h>
  30. #include <omap_drm.h>
  31. struct omap_bo;
  32. struct omap_device;
  33. /* device related functions:
  34. */
  35. struct omap_device * omap_device_new(int fd);
  36. struct omap_device * omap_device_ref(struct omap_device *dev);
  37. void omap_device_del(struct omap_device *dev);
  38. int omap_get_param(struct omap_device *dev, uint64_t param, uint64_t *value);
  39. int omap_set_param(struct omap_device *dev, uint64_t param, uint64_t value);
  40. /* buffer-object related functions:
  41. */
  42. struct omap_bo * omap_bo_new(struct omap_device *dev,
  43. uint32_t size, uint32_t flags);
  44. struct omap_bo * omap_bo_new_tiled(struct omap_device *dev,
  45. uint32_t width, uint32_t height, uint32_t flags);
  46. struct omap_bo * omap_bo_ref(struct omap_bo *bo);
  47. struct omap_bo * omap_bo_from_name(struct omap_device *dev, uint32_t name);
  48. struct omap_bo * omap_bo_from_dmabuf(struct omap_device *dev, int fd);
  49. void omap_bo_del(struct omap_bo *bo);
  50. int omap_bo_get_name(struct omap_bo *bo, uint32_t *name);
  51. uint32_t omap_bo_handle(struct omap_bo *bo);
  52. int omap_bo_dmabuf(struct omap_bo *bo);
  53. uint32_t omap_bo_size(struct omap_bo *bo);
  54. void * omap_bo_map(struct omap_bo *bo);
  55. int omap_bo_cpu_prep(struct omap_bo *bo, enum omap_gem_op op);
  56. int omap_bo_cpu_fini(struct omap_bo *bo, enum omap_gem_op op);
  57. #endif /* OMAP_DRMIF_H_ */