Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
0002 /*
0003  * include/uapi/drm/omap_drm.h
0004  *
0005  * Copyright (C) 2011 Texas Instruments
0006  * Author: Rob Clark <rob@ti.com>
0007  *
0008  * This program is free software; you can redistribute it and/or modify it
0009  * under the terms of the GNU General Public License version 2 as published by
0010  * the Free Software Foundation.
0011  *
0012  * This program is distributed in the hope that it will be useful, but WITHOUT
0013  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
0014  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
0015  * more details.
0016  *
0017  * You should have received a copy of the GNU General Public License along with
0018  * this program.  If not, see <http://www.gnu.org/licenses/>.
0019  */
0020 
0021 #ifndef __OMAP_DRM_H__
0022 #define __OMAP_DRM_H__
0023 
0024 #include "drm.h"
0025 
0026 #if defined(__cplusplus)
0027 extern "C" {
0028 #endif
0029 
0030 /* Please note that modifications to all structs defined here are
0031  * subject to backwards-compatibility constraints.
0032  */
0033 
0034 #define OMAP_PARAM_CHIPSET_ID   1   /* ie. 0x3430, 0x4430, etc */
0035 
0036 struct drm_omap_param {
0037     __u64 param;            /* in */
0038     __u64 value;            /* in (set_param), out (get_param) */
0039 };
0040 
0041 /* Scanout buffer, consumable by DSS */
0042 #define OMAP_BO_SCANOUT     0x00000001
0043 
0044 /* Buffer CPU caching mode: cached, write-combining or uncached. */
0045 #define OMAP_BO_CACHED      0x00000000
0046 #define OMAP_BO_WC      0x00000002
0047 #define OMAP_BO_UNCACHED    0x00000004
0048 #define OMAP_BO_CACHE_MASK  0x00000006
0049 
0050 /* Use TILER for the buffer. The TILER container unit can be 8, 16 or 32 bits. */
0051 #define OMAP_BO_TILED_8     0x00000100
0052 #define OMAP_BO_TILED_16    0x00000200
0053 #define OMAP_BO_TILED_32    0x00000300
0054 #define OMAP_BO_TILED_MASK  0x00000f00
0055 
0056 union omap_gem_size {
0057     __u32 bytes;        /* (for non-tiled formats) */
0058     struct {
0059         __u16 width;
0060         __u16 height;
0061     } tiled;        /* (for tiled formats) */
0062 };
0063 
0064 struct drm_omap_gem_new {
0065     union omap_gem_size size;   /* in */
0066     __u32 flags;            /* in */
0067     __u32 handle;           /* out */
0068     __u32 __pad;
0069 };
0070 
0071 /* mask of operations: */
0072 enum omap_gem_op {
0073     OMAP_GEM_READ = 0x01,
0074     OMAP_GEM_WRITE = 0x02,
0075 };
0076 
0077 struct drm_omap_gem_cpu_prep {
0078     __u32 handle;           /* buffer handle (in) */
0079     __u32 op;           /* mask of omap_gem_op (in) */
0080 };
0081 
0082 struct drm_omap_gem_cpu_fini {
0083     __u32 handle;           /* buffer handle (in) */
0084     __u32 op;           /* mask of omap_gem_op (in) */
0085     /* TODO maybe here we pass down info about what regions are touched
0086      * by sw so we can be clever about cache ops?  For now a placeholder,
0087      * set to zero and we just do full buffer flush..
0088      */
0089     __u32 nregions;
0090     __u32 __pad;
0091 };
0092 
0093 struct drm_omap_gem_info {
0094     __u32 handle;           /* buffer handle (in) */
0095     __u32 pad;
0096     __u64 offset;           /* mmap offset (out) */
0097     /* note: in case of tiled buffers, the user virtual size can be
0098      * different from the physical size (ie. how many pages are needed
0099      * to back the object) which is returned in DRM_IOCTL_GEM_OPEN..
0100      * This size here is the one that should be used if you want to
0101      * mmap() the buffer:
0102      */
0103     __u32 size;         /* virtual size for mmap'ing (out) */
0104     __u32 __pad;
0105 };
0106 
0107 #define DRM_OMAP_GET_PARAM      0x00
0108 #define DRM_OMAP_SET_PARAM      0x01
0109 #define DRM_OMAP_GEM_NEW        0x03
0110 #define DRM_OMAP_GEM_CPU_PREP       0x04    /* Deprecated, to be removed */
0111 #define DRM_OMAP_GEM_CPU_FINI       0x05    /* Deprecated, to be removed */
0112 #define DRM_OMAP_GEM_INFO       0x06
0113 #define DRM_OMAP_NUM_IOCTLS     0x07
0114 
0115 #define DRM_IOCTL_OMAP_GET_PARAM    DRM_IOWR(DRM_COMMAND_BASE + DRM_OMAP_GET_PARAM, struct drm_omap_param)
0116 #define DRM_IOCTL_OMAP_SET_PARAM    DRM_IOW (DRM_COMMAND_BASE + DRM_OMAP_SET_PARAM, struct drm_omap_param)
0117 #define DRM_IOCTL_OMAP_GEM_NEW      DRM_IOWR(DRM_COMMAND_BASE + DRM_OMAP_GEM_NEW, struct drm_omap_gem_new)
0118 #define DRM_IOCTL_OMAP_GEM_CPU_PREP DRM_IOW (DRM_COMMAND_BASE + DRM_OMAP_GEM_CPU_PREP, struct drm_omap_gem_cpu_prep)
0119 #define DRM_IOCTL_OMAP_GEM_CPU_FINI DRM_IOW (DRM_COMMAND_BASE + DRM_OMAP_GEM_CPU_FINI, struct drm_omap_gem_cpu_fini)
0120 #define DRM_IOCTL_OMAP_GEM_INFO     DRM_IOWR(DRM_COMMAND_BASE + DRM_OMAP_GEM_INFO, struct drm_omap_gem_info)
0121 
0122 #if defined(__cplusplus)
0123 }
0124 #endif
0125 
0126 #endif /* __OMAP_DRM_H__ */