diff options
| author | Daniel Vetter <daniel.vetter@ffwll.ch> | 2016-09-21 04:59:26 -0400 |
|---|---|---|
| committer | Sean Paul <seanpaul@chromium.org> | 2016-09-22 03:04:01 -0400 |
| commit | 18733802466d032cd84e57f1e4b21ecae635f192 (patch) | |
| tree | f8a031317b0fa8e55b5896152d10aefddbb853e1 /include/drm | |
| parent | 532b36712ddfdca90f4db9a5365039cc08a3ff84 (diff) | |
drm: Conslidate blending properties in drm_blend.[hc]
Imo zpos, rotatation, blending eq (once we have it) and all that
should be in drm_blend.c, since those are all about how exactly the
pixels are rendered onto the CRTC's visible area. Also noticed that
one exported function accidentally ended up in drm_crtc_internal.h,
move it to the right place too.
Reviewed-by: Sean Paul <seanpaul@chromium.org>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Link: http://patchwork.freedesktop.org/patch/msgid/1474448370-32227-3-git-send-email-daniel.vetter@ffwll.ch
Diffstat (limited to 'include/drm')
| -rw-r--r-- | include/drm/drm_blend.h | 59 | ||||
| -rw-r--r-- | include/drm/drm_crtc.h | 27 |
2 files changed, 60 insertions, 26 deletions
diff --git a/include/drm/drm_blend.h b/include/drm/drm_blend.h new file mode 100644 index 000000000000..868f0364e939 --- /dev/null +++ b/include/drm/drm_blend.h | |||
| @@ -0,0 +1,59 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (c) 2016 Intel Corporation | ||
| 3 | * | ||
| 4 | * Permission to use, copy, modify, distribute, and sell this software and its | ||
| 5 | * documentation for any purpose is hereby granted without fee, provided that | ||
| 6 | * the above copyright notice appear in all copies and that both that copyright | ||
| 7 | * notice and this permission notice appear in supporting documentation, and | ||
| 8 | * that the name of the copyright holders not be used in advertising or | ||
| 9 | * publicity pertaining to distribution of the software without specific, | ||
| 10 | * written prior permission. The copyright holders make no representations | ||
| 11 | * about the suitability of this software for any purpose. It is provided "as | ||
| 12 | * is" without express or implied warranty. | ||
| 13 | * | ||
| 14 | * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, | ||
| 15 | * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO | ||
| 16 | * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR | ||
| 17 | * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, | ||
| 18 | * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER | ||
| 19 | * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE | ||
| 20 | * OF THIS SOFTWARE. | ||
| 21 | */ | ||
| 22 | |||
| 23 | #ifndef __DRM_BLEND_H__ | ||
| 24 | #define __DRM_BLEND_H__ | ||
| 25 | |||
| 26 | #include <linux/list.h> | ||
| 27 | #include <linux/ctype.h> | ||
| 28 | |||
| 29 | struct drm_device; | ||
| 30 | struct drm_atomic_state; | ||
| 31 | |||
| 32 | /* | ||
| 33 | * Rotation property bits. DRM_ROTATE_<degrees> rotates the image by the | ||
| 34 | * specified amount in degrees in counter clockwise direction. DRM_REFLECT_X and | ||
| 35 | * DRM_REFLECT_Y reflects the image along the specified axis prior to rotation | ||
| 36 | */ | ||
| 37 | #define DRM_ROTATE_0 BIT(0) | ||
| 38 | #define DRM_ROTATE_90 BIT(1) | ||
| 39 | #define DRM_ROTATE_180 BIT(2) | ||
| 40 | #define DRM_ROTATE_270 BIT(3) | ||
| 41 | #define DRM_ROTATE_MASK (DRM_ROTATE_0 | DRM_ROTATE_90 | \ | ||
| 42 | DRM_ROTATE_180 | DRM_ROTATE_270) | ||
| 43 | #define DRM_REFLECT_X BIT(4) | ||
| 44 | #define DRM_REFLECT_Y BIT(5) | ||
| 45 | #define DRM_REFLECT_MASK (DRM_REFLECT_X | DRM_REFLECT_Y) | ||
| 46 | |||
| 47 | struct drm_property *drm_mode_create_rotation_property(struct drm_device *dev, | ||
| 48 | unsigned int supported_rotations); | ||
| 49 | unsigned int drm_rotation_simplify(unsigned int rotation, | ||
| 50 | unsigned int supported_rotations); | ||
| 51 | |||
| 52 | int drm_plane_create_zpos_property(struct drm_plane *plane, | ||
| 53 | unsigned int zpos, | ||
| 54 | unsigned int min, unsigned int max); | ||
| 55 | int drm_plane_create_zpos_immutable_property(struct drm_plane *plane, | ||
| 56 | unsigned int zpos); | ||
| 57 | int drm_atomic_normalize_zpos(struct drm_device *dev, | ||
| 58 | struct drm_atomic_state *state); | ||
| 59 | #endif | ||
diff --git a/include/drm/drm_crtc.h b/include/drm/drm_crtc.h index 9375e5c9cddb..8d06cabede59 100644 --- a/include/drm/drm_crtc.h +++ b/include/drm/drm_crtc.h | |||
| @@ -45,6 +45,7 @@ | |||
| 45 | #include <drm/drm_bridge.h> | 45 | #include <drm/drm_bridge.h> |
| 46 | #include <drm/drm_edid.h> | 46 | #include <drm/drm_edid.h> |
| 47 | #include <drm/drm_plane.h> | 47 | #include <drm/drm_plane.h> |
| 48 | #include <drm/drm_blend.h> | ||
| 48 | 49 | ||
| 49 | struct drm_device; | 50 | struct drm_device; |
| 50 | struct drm_mode_set; | 51 | struct drm_mode_set; |
| @@ -63,21 +64,6 @@ static inline uint64_t I642U64(int64_t val) | |||
| 63 | return (uint64_t)*((uint64_t *)&val); | 64 | return (uint64_t)*((uint64_t *)&val); |
| 64 | } | 65 | } |
| 65 | 66 | ||
| 66 | /* | ||
| 67 | * Rotation property bits. DRM_ROTATE_<degrees> rotates the image by the | ||
| 68 | * specified amount in degrees in counter clockwise direction. DRM_REFLECT_X and | ||
| 69 | * DRM_REFLECT_Y reflects the image along the specified axis prior to rotation | ||
| 70 | */ | ||
| 71 | #define DRM_ROTATE_0 BIT(0) | ||
| 72 | #define DRM_ROTATE_90 BIT(1) | ||
| 73 | #define DRM_ROTATE_180 BIT(2) | ||
| 74 | #define DRM_ROTATE_270 BIT(3) | ||
| 75 | #define DRM_ROTATE_MASK (DRM_ROTATE_0 | DRM_ROTATE_90 | \ | ||
| 76 | DRM_ROTATE_180 | DRM_ROTATE_270) | ||
| 77 | #define DRM_REFLECT_X BIT(4) | ||
| 78 | #define DRM_REFLECT_Y BIT(5) | ||
| 79 | #define DRM_REFLECT_MASK (DRM_REFLECT_X | DRM_REFLECT_Y) | ||
| 80 | |||
| 81 | /* data corresponds to displayid vend/prod/serial */ | 67 | /* data corresponds to displayid vend/prod/serial */ |
| 82 | struct drm_tile_group { | 68 | struct drm_tile_group { |
| 83 | struct kref refcount; | 69 | struct kref refcount; |
| @@ -1363,22 +1349,11 @@ extern struct drm_tile_group *drm_mode_get_tile_group(struct drm_device *dev, | |||
| 1363 | extern void drm_mode_put_tile_group(struct drm_device *dev, | 1349 | extern void drm_mode_put_tile_group(struct drm_device *dev, |
| 1364 | struct drm_tile_group *tg); | 1350 | struct drm_tile_group *tg); |
| 1365 | 1351 | ||
| 1366 | extern struct drm_property *drm_mode_create_rotation_property(struct drm_device *dev, | ||
| 1367 | unsigned int supported_rotations); | ||
| 1368 | extern unsigned int drm_rotation_simplify(unsigned int rotation, | ||
| 1369 | unsigned int supported_rotations); | ||
| 1370 | extern void drm_crtc_enable_color_mgmt(struct drm_crtc *crtc, | 1352 | extern void drm_crtc_enable_color_mgmt(struct drm_crtc *crtc, |
| 1371 | uint degamma_lut_size, | 1353 | uint degamma_lut_size, |
| 1372 | bool has_ctm, | 1354 | bool has_ctm, |
| 1373 | uint gamma_lut_size); | 1355 | uint gamma_lut_size); |
| 1374 | 1356 | ||
| 1375 | int drm_plane_create_zpos_property(struct drm_plane *plane, | ||
| 1376 | unsigned int zpos, | ||
| 1377 | unsigned int min, unsigned int max); | ||
| 1378 | |||
| 1379 | int drm_plane_create_zpos_immutable_property(struct drm_plane *plane, | ||
| 1380 | unsigned int zpos); | ||
| 1381 | |||
| 1382 | /* Helpers */ | 1357 | /* Helpers */ |
| 1383 | static inline struct drm_crtc *drm_crtc_find(struct drm_device *dev, | 1358 | static inline struct drm_crtc *drm_crtc_find(struct drm_device *dev, |
| 1384 | uint32_t id) | 1359 | uint32_t id) |
