aboutsummaryrefslogtreecommitdiffstats
path: root/exynos
Commit message (Collapse)AuthorAgeFilesLines
* meson,configure: include config.h automaticallyEric Engestrom2018-03-202-8/+0
| | | | | | | | | This will prevent any more missing `#include "config.h"` bug, at the cost of having to recompile some files that didn't need to be when changing build options. Signed-off-by: Eric Engestrom <eric.engestrom@imgtec.com> Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
* *-symbol-check: Don't hard-code nm executableHeiko Becker2018-02-232-1/+2
| | | | | | | | | | | | Helpful if your nm executable has a prefix based on the architecture, for example. Signed-off-by: Heiko Becker <heirecka@exherbo.org> Cc: Timo Gurr <timo.gurr@gmail.com> [Eric: v2: rebase and add Meson support] Signed-off-by: Eric Engestrom <eric.engestrom@imgtec.com> Reviewed-by: Eric Anholt <eric@anholt.net> Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
* Add meson build systemDylan Baker2018-01-121-0/+53
| | | | | | | | | | This patch adds a complete meson build system, including tests and install. It has the necessary hooks to allow it be used as a subproject for other meson based builds such as mesa. Signed-off-by: Dylan Baker <dylan.c.baker@intel.com> Reviewed-and-tested-by: Igor Gnatenko <i.gnatenko.brain@gmail.com> Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
* exynos: change the license to X11/MITInki Dae2017-11-073-12/+51
| | | | | | | | | | | | | | | | | | | | | | Change GPL license of Exynos related code to X11/MIT. I'd like to keep a consistent license across all Exynos code because License checker notices two more licenses exist in libdrm. For the license change I need to get your agree - all committers. So please give me Acked-by if you agree with me. Signed-off-by: Inki Dae <inki.dae@samsung.com> Acked-by: Hyungwon Hwang <human.hwang@samsung.com> Acked-by: SooChan Lim <sc1.lim@samsung.com> Acked-by: Sangjin LEE <lsj119@samsung.com> Acked-by: Boram Park <boram1288.park@samsung.com> Acked-by: Seung-Woo Kim <sw0312.kim@samsung.com> Acked-by: Joonyoung Shim <jy0922.shim@samsung.com> Acked-by: Emil Velikov <emil.l.velikov@gmail.com> Acked-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de> Acked-by: Jan Vesely <jan.vesely@rutgers.edu>
* exynos: add C++ support to exynos_drmif headerTobias Jakobi2017-04-081-0/+8
| | | | | | | | Add the usual extern "C" when compiling in C++ mode. Signed-off-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de> Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com> Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
* exynos/fimg2d: remove unused-function build warningSeung-Woo Kim2017-04-031-14/+0
| | | | | | | | | | The function g2d_reset() is not anymore used after the commit e3c97d1a2473 ("exynos/fimg2d: add g2d_validate_xyz() functions"), so it should be removed. Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com> Reviewed-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de> Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
* exynos: fix type-punned pointer build warningSeung-Woo Kim2017-04-031-1/+1
| | | | | | | | | | | | | | As like the commit ecc2a097294d ("xf86drm: Fix type-punned pointer build warning"), this fixes following build warning. exynos_drm.c: In function 'exynos_handle_event': exynos_drm.c:420:15: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] e = (struct drm_event *) &buffer[i]; ^ Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com> Reviewed-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de> Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
* exynos: Fix spelling mistakeEric Engestrom2016-04-071-1/+1
| | | | | Signed-off-by: Eric Engestrom <eric@engestrom.ch> Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
* exynos: bump version numberTobias Jakobi2015-12-181-1/+1
| | | | | | | The Exynos API was extended quite a bit, so reflect this in the version number. Signed-off-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de>
* tests/exynos: add test for g2d_moveTobias Jakobi2015-12-181-0/+1
| | | | | | | | | | | | | To check if g2d_move() works properly we create a small checkerboard pattern in the center of the screen and then shift this pattern around with g2d_move(). The pattern should be properly preserved by the operation (but not the surrounding area). Tested-by: Hyungwon Hwang <human.hwang@samsung.com> Reviewed-by: Hyungwon Hwang <human.hwang@samsung.com> Signed-off-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de> [Emil Velikov: add g2d_move to the symbol check] Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
* exynos/fimg2d: add g2d_moveTobias Jakobi2015-12-182-0/+98
| | | | | | | | | | | We already have g2d_copy() which implements G2D copy operations from one buffer to another. However we can't do a overlapping copy operation in one buffer. Add g2d_move() which acts like the standard memmove() and properly handles overlapping copies. Signed-off-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de>
* exynos: fimg2d: add g2d_set_directionTobias Jakobi2015-12-181-0/+51
| | | | | | | | | | | This allows setting the two direction registers, which specify how the engine blits pixels. This can be used for overlapping blits, which happen e.g. when 'moving' a rectangular region inside a fixed buffer. Reviewed-by: Hyungwon Hwang <human.hwang@samsung.com> Signed-off-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de> Signed-off-by: Hyungwon Hwang <human.hwang@samsung.com>
* exynos/fimg2d: add g2d_config_eventTobias Jakobi2015-12-183-2/+28
| | | | | | | | | | | | | This enables us to pass command buffers to the kernel which trigger an event on the DRM fd upon completion. The final goal is to enable asynchronous operation of the G2D engine, similar to async page flips. Passing the event userdata pointer through the G2D context was chosen to not change the current API (e.g. by adding a userdata argument to each public functions). Signed-off-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de>
* exynos: Introduce exynos_handle_event()Tobias Jakobi2015-12-184-0/+115
| | | | | | | | Used to handle kernel events specific to the Exynos platform. Currently only G2D events are handled. Signed-off-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de> Signed-off-by: Hyungwon Hwang <human.hwang@samsung.com>
* exynos/fimg2d: remove g2d_context from public headerTobias Jakobi2015-09-212-13/+16
| | | | | | | | | | | | All functions from the public API only operation on struct g2d_context*, so this shouldn't break too much. Make the context private since we don't want the user to modify its content directly. Also remove the defines that were only used for fields of g2d_context. Signed-off-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de>
* exynos/fimg2d: add message prefixTobias Jakobi2015-09-211-14/+16
| | | | | | | | | Add a prefix to the messages printed to the console via printf() and fprintf() so that one can easily see where the message comes from. Signed-off-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de> Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
* exynos/fimg2d: make g2d_add_cmd() less heavyTobias Jakobi2015-09-211-11/+7
| | | | | | | | | | | | | | | | | | | | | | The function currently checks for each added command if an overflow of the corresponding command buffers occurs, but none of the callers ever checks the return value. Since all callers are now converted to use g2d_check_space() simplify the function. (1) The overflow checks become asserts, so they're only active for debug builds. This is fine since g2d_add_cmd() is not part of the public API. (2) Switch the return value to void. (3) Explicitly state that the caller has to check buffer space before calling g2d_add_cmd(). Signed-off-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de> Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
* exynos/fimg2d: remove superfluous initialization of g2d_point_valTobias Jakobi2015-09-211-19/+0
| | | | | | | | | The g2d_point_val union consists of two coordinates of 16 bits. Whenever this union is used though, both coordinates are explicitly set. Hence prior initialization is unnecessary. Signed-off-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de> Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
* exynos/fimg2d: remove default case from g2d_get_blend_op()Tobias Jakobi2015-09-211-5/+5
| | | | | | | | We now validate the blending mode via g2d_validate_mode() prior to feeding it to g2d_get_blend_op(). Signed-off-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de> Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
* exynos/fimg2d: add g2d_validate_xyz() functionsTobias Jakobi2015-09-211-55/+126
| | | | | | | | | | | | | | | | | | | | The G2D headers define a number of modes through enums (like e.g. color, select, repeat, etc.). This introduces g2d_validate_select_mode() and g2d_validate_blending_op() which validate a select mode or blending operation respectively. Use this together with g2d_check_space() in g2d_{blend,scale_and_blend}(). For this we move parameter validation to the top and also validate the select mode of the source image and the requested blending operation before starting command submission. Signed-off-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de> Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
* exynos/fimg2d: add g2d_check_space()Tobias Jakobi2015-09-211-35/+64
| | | | | | | | | | | | | | | | | | This is going to be used to check if the command buffers have enough space left prior to actual submission of the commands. Use this in g2d_{solid_fill,copy,copy_with_scale}(). For this the parameter validation before buffer space checking so that we can exit early if it fails. Also don't reset the G2D context in this situation since the buffers are not partially submitted anymore. The repeat mode in g2d_copy_with_scale() is checked first to make computation of space easier. Signed-off-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de> Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
* exynos/fimg2d: simplify base address submission in g2d_scale_and_blend()Tobias Jakobi2015-09-211-12/+2
| | | | | | | | Use g2d_add_base_addr() for source and destination base address just like all other calls. Signed-off-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de> Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
* exynos/fimg2d: fix empty buffer handling in g2d_flush()Tobias Jakobi2015-09-211-1/+1
| | | | | | | | Empty command buffers are no error, we just don't have anything to do for flushing then. Signed-off-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de> Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
* exynos/fimg2d: simplify g2d_fini()Tobias Jakobi2015-06-291-2/+1
| | | | | | | free()ing a nullptr is a noop, so remove the check. Signed-off-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de> Acked-by: Emil Velikov <emil.l.velikov@gmail.com>
* exynos: fimg2d: fix return codesTobias Jakobi2015-06-291-15/+5
| | | | | | | | | | | | | Even if flushing the command buffer doesn't succeed, the G2D calls would still return zero. Fix this by just passing the flush return code. In fact error handling currently ignores the fact that g2d_add_cmd() can fail. This is going to be handled in a later patch. Signed-off-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de> Acked-by: Emil Velikov <emil.l.velikov@gmail.com>
* drm: remove drm_public macroEmil Velikov2015-04-282-20/+20
| | | | | | | | | | | | | | | Some compilers (like the Oracle Studio), require that the function declaration must be annotated with the same visibility attribute as the definition. As annotating functions with drm_public is no longer required just remove the macro. Cc: Ben Skeggs <bskeggs@redhat.com> Cc: Damien Lespiau <damien.lespiau@intel.com> Cc: Maarten Lankhorst <maarten.lankhorst@canonical.com> Cc: Michel Dänzer <michel.daenzer@amd.com> Cc: Rob Clark <robdclark@gmail.com> Cc: Thierry Reding <treding@nvidia.com> Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
* drm: remove no longer needed VISIBILITY_CFLAGSEmil Velikov2015-04-281-1/+0
| | | | | | | | | | | | | With earlier commits we've annotated the private symbols, thus we no longer require the -fvisibility=hidden CFLAGS. Cc: Ben Skeggs <bskeggs@redhat.com> Cc: Damien Lespiau <damien.lespiau@intel.com> Cc: Maarten Lankhorst <maarten.lankhorst@canonical.com> Cc: Michel Dänzer <michel.daenzer@amd.com> Cc: Rob Clark <robdclark@gmail.com> Cc: Thierry Reding <treding@nvidia.com> Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
* drm: rename libdrm{,_macros}.hEmil Velikov2015-04-282-2/+2
| | | | | | Provide a more meaningful name, considering what it does. Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
* exynos: add symbols testEmil Velikov2015-04-282-0/+40
| | | | Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
* autotools: remove ${srcdir} from the includesEmil Velikov2015-03-201-1/+0
| | | | | | | | Already handled by the build system. v2: s/compiler/build system/ Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
* exynos: fimg2d: follow-up fix for G2D_COEFF_MODE_GB_COLORTobias Jakobi2015-03-161-1/+7
| | | | | | | | Also add the register field formatting info provided by Inki Dae <inki.dae@samsung.com>. Signed-off-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de> Suggested-by: Inki Dae <inki.dae@samsung.com>
* exynos: add fimg2d header to common includesTobias Jakobi2015-03-161-2/+1
| | | | | | | | | The reason for this change is to let userspace use the header. Currently 'make install' does not install it. Signed-off-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de> Reviewed-by: Inki Dae <inki.dae@samsung.com> Tested-by: Joonyoung Shim <jy0922.shim@samsung.com>
* exynos: add exynos prefix to fimg2d headerTobias Jakobi2015-03-163-2/+2
| | | | | | Signed-off-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de> Reviewed-by: Inki Dae <inki.dae@samsung.com> Tested-by: Joonyoung Shim <jy0922.shim@samsung.com>
* exynos: use structure initialization instead of memsetTobias Jakobi2015-03-161-3/+1
| | | | | | | | | | | | | | Keeps the code cleaner, since the structs have to be initialized once anyway. Signed-off-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de> Reviewed-by: Inki Dae <inki.dae@samsung.com> Tested-by: Joonyoung Shim <jy0922.shim@samsung.com> [evelikov: squash trivial conflict] Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com> Conflicts: tests/exynos/exynos_fimg2d_test.c
* exynos: honor the repeat mode in g2d_copy_with_scaleTobias Jakobi2015-03-161-0/+5
| | | | | | | | | | | | | | | | This is useful when the default repeat mode, which is 'repeat' produces artifacts at the borders of the copied image. Choose the 'pad' mode to make use of the color of the destination image. In my usage case the destination is the framebuffer, which is solid filled with a background color. Scaling with 'pad' mode would then just do the right thing and also produces nice borders on the output. Signed-off-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de> Reviewed-by: Inki Dae <inki.dae@samsung.com> Tested-by: Joonyoung Shim <jy0922.shim@samsung.com>
* exynos: add g2d_scale_and_blendTobias Jakobi2015-03-162-0/+134
| | | | | | | | | | | This is a combination of g2d_copy_with_scale and g2d_scale. It is a pretty common operation to scale one buffer and then blend it on top of another, so provide a direct way to that operation. Signed-off-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de> Reviewed-by: Inki Dae <inki.dae@samsung.com> Tested-by: Joonyoung Shim <jy0922.shim@samsung.com>
* exynos: fimg2d: whitespace fix in g2d_flushTobias Jakobi2015-03-101-1/+1
| | | | | Signed-off-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de> Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
* exynos: fimg2d: introduce G2D_OP_INTERPOLATETobias Jakobi2015-03-102-0/+5
| | | | | | | | | This sets up the blending equation in the following way: out = src * src_alpha + dst * (1 - src_alpha) Signed-off-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de> Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com> Tested-by: Joonyoung Shim <jy0922.shim@samsung.com>
* exynos: fimg2d: unify register styleTobias Jakobi2015-03-101-1/+1
| | | | | | | | Register defines all use uppercase hex codes. Signed-off-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de> Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com> Tested-by: Joonyoung Shim <jy0922.shim@samsung.com>
* exynos: fimg2d: fix comment for G2D_COEFF_MODE_GB_COLORTobias Jakobi2015-03-101-1/+1
| | | | | | | | The coefficient mode enables use of global color, not alpha. Signed-off-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de> Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com> Tested-by: Joonyoung Shim <jy0922.shim@samsung.com>
* exynos: fimg2d: remove TRUE/FALSE from headerTobias Jakobi2015-03-102-9/+2
| | | | | | | | | The fimg2d header was defining TRUE and FALSE, but actually these defines are just used once. Remove them, since they don't make the code better readable/understandable. Signed-off-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de> Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
* exynos: introduce g2d_add_base_addr helper functionTobias Jakobi2015-03-101-43/+32
| | | | | | | | | | | | In almost all functions the base address register is written, so it makes sense to have a helper function for this. v3: Wrap line as pointed out by Emil Velikov <emil.l.velikov@gmail.com>. Signed-off-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de> Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com> Tested-by: Joonyoung Shim <jy0922.shim@samsung.com>
* tests/exynos: fix typos and change wordingTobias Jakobi2015-03-101-4/+4
| | | | | | | | No functional changes. Signed-off-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de> Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com> Tested-by: Joonyoung Shim <jy0922.shim@samsung.com>
* exynos: replace G2D_DOUBLE_TO_FIXED macro with functionTobias Jakobi2015-03-102-7/+17
| | | | | | | | | | | | | | | This also avoids the floating point conversion steps and just uses pure integer arithmetic. Since the G2D hardware scaling approach is a bit unintuitive, document it in the function as well. v2: Explicitly mention the normalization constant. v3: Use common commenting style as pointed out by Emil Velikov <emil.l.velikov@gmail.com>. Signed-off-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de> Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com> Tested-by: Joonyoung Shim <jy0922.shim@samsung.com>
* exynos: remove DRM_EXYNOS_GEM_{MAP_OFFSET/MMAP} ioctlsHyungwon Hwang2015-02-021-40/+0
| | | | | | | | | This patch removes the ioctls which are removed from the linux kernel. Signed-off-by: Hyungwon Hwang <human.hwang@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com> Signed-off-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de> Signed-off-by: Rob Clark <robclark@freedesktop.org>
* exynos: Don't use DRM_EXYNOS_GEM_{MAP_OFFSET/MMAP} ioctlsHyungwon Hwang2015-02-021-7/+12
| | | | | | | | | | | | | | | | | | | | The ioctl DRM_EXYNOS_GEM_MAP_OFFSET and DRM_EXYNOS_GEM_MMAP are removed from the linux kernel. This patch modifies libdrm and libkms to use drm generic ioctls instead of the removed ioctls. v2: The original patch was erroneous. In case the MODE_MAP_DUMB ioctl failed it would return the retvalue as a void-pointer. Users of libdrm would then happily use that ptr, eventually leading to a segfault. Change this to return NULL in that case and also restore the previous behaviour of logging to stderr. The other error was that 'bo->vaddr' was never filled with the mapped buffer address. Hence exynos_bo_map still returned NULL even if the buffer mapping succeeded. Signed-off-by: Hyungwon Hwang <human.hwang@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com> Signed-off-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de> Signed-off-by: Rob Clark <robclark@freedesktop.org>
* exynos: Use symbol visibility.Maarten Lankhorst2014-08-143-24/+33
| | | | | | No changes to exported symbols. Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
* exynos: fix scaling factor computation in g2d_copy_with_scaleTobias Jakobi2014-06-201-1/+1
| | | | | | | | | When division of source and destination width yields the scaling factor for the x-coordinate, then it should be source/destination _height_ for y. Signed-off-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de> Signed-off-by: Inki Dae <inki.dae@samsung.com>
* exynos: fix G2D_DOUBLE_TO_FIXED for non-integer inputTobias Jakobi2014-06-201-1/+1
| | | | | | | | | | | | The hardware accepts scaling factors formatted in a fixed-point format. The current macro casts to integer first, then multiplies by the fp conversion factor. This does not make any sense. In particular, truly 'fractional' inputs, like 1.5, won't work that way. Signed-off-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de> Signed-off-by: Inki Dae <inki.dae@samsung.com>
* exynos: fix coordinate computation in g2d_copyTobias Jakobi2014-06-201-1/+1
| | | | | | | | The right-bottom register isn't set correctly. Looks like a copy-and-paste error. Signed-off-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de> Signed-off-by: Inki Dae <inki.dae@samsung.com>