Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0+ */
0002 /*
0003  * Copyright (C) 2018 BayLibre, SAS
0004  */
0005 #ifndef __SOC_MESON_CANVAS_H
0006 #define __SOC_MESON_CANVAS_H
0007 
0008 #include <linux/kernel.h>
0009 
0010 #define MESON_CANVAS_WRAP_NONE  0x00
0011 #define MESON_CANVAS_WRAP_X 0x01
0012 #define MESON_CANVAS_WRAP_Y 0x02
0013 
0014 #define MESON_CANVAS_BLKMODE_LINEAR 0x00
0015 #define MESON_CANVAS_BLKMODE_32x32  0x01
0016 #define MESON_CANVAS_BLKMODE_64x64  0x02
0017 
0018 #define MESON_CANVAS_ENDIAN_SWAP16  0x1
0019 #define MESON_CANVAS_ENDIAN_SWAP32  0x3
0020 #define MESON_CANVAS_ENDIAN_SWAP64  0x7
0021 #define MESON_CANVAS_ENDIAN_SWAP128 0xf
0022 
0023 struct device;
0024 struct meson_canvas;
0025 
0026 /**
0027  * meson_canvas_get() - get a canvas provider instance
0028  *
0029  * @dev: consumer device pointer
0030  */
0031 struct meson_canvas *meson_canvas_get(struct device *dev);
0032 
0033 /**
0034  * meson_canvas_alloc() - take ownership of a canvas
0035  *
0036  * @canvas: canvas provider instance retrieved from meson_canvas_get()
0037  * @canvas_index: will be filled with the canvas ID
0038  */
0039 int meson_canvas_alloc(struct meson_canvas *canvas, u8 *canvas_index);
0040 
0041 /**
0042  * meson_canvas_free() - remove ownership from a canvas
0043  *
0044  * @canvas: canvas provider instance retrieved from meson_canvas_get()
0045  * @canvas_index: canvas ID that was obtained via meson_canvas_alloc()
0046  */
0047 int meson_canvas_free(struct meson_canvas *canvas, u8 canvas_index);
0048 
0049 /**
0050  * meson_canvas_config() - configure a canvas
0051  *
0052  * @canvas: canvas provider instance retrieved from meson_canvas_get()
0053  * @canvas_index: canvas ID that was obtained via meson_canvas_alloc()
0054  * @addr: physical address to the pixel buffer
0055  * @stride: width of the buffer
0056  * @height: height of the buffer
0057  * @wrap: undocumented
0058  * @blkmode: block mode (linear, 32x32, 64x64)
0059  * @endian: byte swapping (swap16, swap32, swap64, swap128)
0060  */
0061 int meson_canvas_config(struct meson_canvas *canvas, u8 canvas_index,
0062             u32 addr, u32 stride, u32 height,
0063             unsigned int wrap, unsigned int blkmode,
0064             unsigned int endian);
0065 
0066 #endif