Back to home page

OSCL-LXR

 
 

    


0001 /*
0002  * Copyright (c) 2016 Intel Corporation
0003  *
0004  * Permission to use, copy, modify, distribute, and sell this software and its
0005  * documentation for any purpose is hereby granted without fee, provided that
0006  * the above copyright notice appear in all copies and that both that copyright
0007  * notice and this permission notice appear in supporting documentation, and
0008  * that the name of the copyright holders not be used in advertising or
0009  * publicity pertaining to distribution of the software without specific,
0010  * written prior permission.  The copyright holders make no representations
0011  * about the suitability of this software for any purpose.  It is provided "as
0012  * is" without express or implied warranty.
0013  *
0014  * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
0015  * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
0016  * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
0017  * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
0018  * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
0019  * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
0020  * OF THIS SOFTWARE.
0021  */
0022 
0023 #ifndef __DRM_BLEND_H__
0024 #define __DRM_BLEND_H__
0025 
0026 #include <linux/list.h>
0027 #include <linux/ctype.h>
0028 #include <drm/drm_mode.h>
0029 
0030 #define DRM_MODE_BLEND_PREMULTI     0
0031 #define DRM_MODE_BLEND_COVERAGE     1
0032 #define DRM_MODE_BLEND_PIXEL_NONE   2
0033 
0034 struct drm_device;
0035 struct drm_atomic_state;
0036 struct drm_plane;
0037 
0038 static inline bool drm_rotation_90_or_270(unsigned int rotation)
0039 {
0040     return rotation & (DRM_MODE_ROTATE_90 | DRM_MODE_ROTATE_270);
0041 }
0042 
0043 #define DRM_BLEND_ALPHA_OPAQUE      0xffff
0044 
0045 int drm_plane_create_alpha_property(struct drm_plane *plane);
0046 int drm_plane_create_rotation_property(struct drm_plane *plane,
0047                        unsigned int rotation,
0048                        unsigned int supported_rotations);
0049 unsigned int drm_rotation_simplify(unsigned int rotation,
0050                    unsigned int supported_rotations);
0051 
0052 int drm_plane_create_zpos_property(struct drm_plane *plane,
0053                    unsigned int zpos,
0054                    unsigned int min, unsigned int max);
0055 int drm_plane_create_zpos_immutable_property(struct drm_plane *plane,
0056                          unsigned int zpos);
0057 int drm_atomic_normalize_zpos(struct drm_device *dev,
0058                   struct drm_atomic_state *state);
0059 int drm_plane_create_blend_mode_property(struct drm_plane *plane,
0060                      unsigned int supported_modes);
0061 #endif