linux/drivers/gpu/drm/zocl/zocl_drv.h
<<
>>
Prefs
   1/*
   2 * A GEM style CMA backed memory manager for ZynQ based OpenCL accelerators.
   3 *
   4 * Copyright (C) 2016 Xilinx, Inc. All rights reserved.
   5 *
   6 * Authors:
   7 *    Sonal Santan <sonal.santan@xilinx.com>
   8 *    Umang Parekh <umang.parekh@xilinx.com>
   9 *
  10 * This software is licensed under the terms of the GNU General Public
  11 * License version 2, as published by the Free Software Foundation, and
  12 * may be copied, distributed, and modified under those terms.
  13 *
  14 * This program is distributed in the hope that it will be useful,
  15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
  16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  17 * GNU General Public License for more details.
  18 */
  19
  20#ifndef _ZOCL_DRV_H_
  21#define _ZOCL_DRV_H_
  22#include <drm/drmP.h>
  23#include <drm/drm_gem.h>
  24#include <drm/drm_mm.h>
  25#include <drm/drm_gem_cma_helper.h>
  26
  27struct drm_zocl_bo {
  28        struct drm_gem_cma_object base;
  29        uint32_t                  flags;
  30};
  31
  32struct drm_zocl_dev {
  33        struct drm_device       *ddev;
  34        void __iomem            *regs;
  35        phys_addr_t              res_start;
  36        resource_size_t          res_len;
  37        unsigned int             irq;
  38};
  39
  40static inline struct drm_zocl_bo *to_zocl_bo(struct drm_gem_object *bo)
  41{
  42        return (struct drm_zocl_bo *) bo;
  43}
  44
  45int zocl_create_bo_ioctl(struct drm_device *dev, void *data,
  46                         struct drm_file *filp);
  47int zocl_sync_bo_ioctl(struct drm_device *dev, void *data,
  48                       struct drm_file *filp);
  49int zocl_map_bo_ioctl(struct drm_device *dev, void *data,
  50                      struct drm_file *filp);
  51int zocl_info_bo_ioctl(struct drm_device *dev, void *data,
  52                       struct drm_file *filp);
  53int zocl_pwrite_bo_ioctl(struct drm_device *dev, void *data,
  54                         struct drm_file *filp);
  55int zocl_pread_bo_ioctl(struct drm_device *dev, void *data,
  56                        struct drm_file *filp);
  57void zocl_describe(const struct drm_zocl_bo *obj);
  58
  59#endif
  60