summaryrefslogtreecommitdiff
path: root/exynos
AgeCommit message (Collapse)AuthorFilesLines
2015-12-18exynos: bump version numberTobias Jakobi1-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>
2015-12-18tests/exynos: add test for g2d_moveTobias Jakobi1-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>
2015-12-18exynos/fimg2d: add g2d_moveTobias Jakobi2-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>
2015-12-18exynos: fimg2d: add g2d_set_directionTobias Jakobi1-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>
2015-12-18exynos/fimg2d: add g2d_config_eventTobias Jakobi3-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>
2015-12-18exynos: Introduce exynos_handle_event()Tobias Jakobi4-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>
2015-09-21exynos/fimg2d: remove g2d_context from public headerTobias Jakobi2-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>
2015-09-21exynos/fimg2d: add message prefixTobias Jakobi1-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>
2015-09-21exynos/fimg2d: make g2d_add_cmd() less heavyTobias Jakobi1-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>
2015-09-21exynos/fimg2d: remove superfluous initialization of g2d_point_valTobias Jakobi1-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>
2015-09-21exynos/fimg2d: remove default case from g2d_get_blend_op()Tobias Jakobi1-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>
2015-09-21exynos/fimg2d: add g2d_validate_xyz() functionsTobias Jakobi1-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>
2015-09-21exynos/fimg2d: add g2d_check_space()Tobias Jakobi1-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>
2015-09-21exynos/fimg2d: simplify base address submission in g2d_scale_and_blend()Tobias Jakobi1-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>
2015-09-21exynos/fimg2d: fix empty buffer handling in g2d_flush()Tobias Jakobi1-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>
2015-06-29exynos/fimg2d: simplify g2d_fini()Tobias Jakobi1-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>
2015-06-29exynos: fimg2d: fix return codesTobias Jakobi1-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>
2015-04-28drm: remove drm_public macroEmil Velikov2-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>
2015-04-28drm: remove no longer needed VISIBILITY_CFLAGSEmil Velikov1-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>
2015-04-28drm: rename libdrm{,_macros}.hEmil Velikov2-2/+2
Provide a more meaningful name, considering what it does. Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-04-28exynos: add symbols testEmil Velikov2-0/+40
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-03-20autotools: remove ${srcdir} from the includesEmil Velikov1-1/+0
Already handled by the build system. v2: s/compiler/build system/ Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-03-16exynos: fimg2d: follow-up fix for G2D_COEFF_MODE_GB_COLORTobias Jakobi1-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>
2015-03-16exynos: add fimg2d header to common includesTobias Jakobi1-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>
2015-03-16exynos: add exynos prefix to fimg2d headerTobias Jakobi3-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>
2015-03-16exynos: use structure initialization instead of memsetTobias Jakobi1-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
2015-03-16exynos: honor the repeat mode in g2d_copy_with_scaleTobias Jakobi1-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>
2015-03-16exynos: add g2d_scale_and_blendTobias Jakobi2-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>
2015-03-10exynos: fimg2d: whitespace fix in g2d_flushTobias Jakobi1-1/+1
Signed-off-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de> Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-03-10exynos: fimg2d: introduce G2D_OP_INTERPOLATETobias Jakobi2-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>
2015-03-10exynos: fimg2d: unify register styleTobias Jakobi1-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>
2015-03-10exynos: fimg2d: fix comment for G2D_COEFF_MODE_GB_COLORTobias Jakobi1-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>
2015-03-10exynos: fimg2d: remove TRUE/FALSE from headerTobias Jakobi2-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>
2015-03-10exynos: introduce g2d_add_base_addr helper functionTobias Jakobi1-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>
2015-03-10tests/exynos: fix typos and change wordingTobias Jakobi1-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>
2015-03-10exynos: replace G2D_DOUBLE_TO_FIXED macro with functionTobias Jakobi2-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>
2015-02-02exynos: remove DRM_EXYNOS_GEM_{MAP_OFFSET/MMAP} ioctlsHyungwon Hwang1-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>
2015-02-02exynos: Don't use DRM_EXYNOS_GEM_{MAP_OFFSET/MMAP} ioctlsHyungwon Hwang1-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>
2014-08-14exynos: Use symbol visibility.Maarten Lankhorst3-24/+33
No changes to exported symbols. Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
2014-06-20exynos: fix scaling factor computation in g2d_copy_with_scaleTobias Jakobi1-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>
2014-06-20exynos: fix G2D_DOUBLE_TO_FIXED for non-integer inputTobias Jakobi1-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>
2014-06-20exynos: fix coordinate computation in g2d_copyTobias Jakobi1-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>
2014-05-12exynos: removed unused fd fieldDaniel Kurtz1-2/+0
The documentation says fd holds the fd from prime import/export. However, it isn't actually used, nor is it necessary, so let's just remove it. Signed-off-by: Daniel Kurtz <djkurtz@chromium.org> Acked-by: Inki Dae <inki.dae@samsung.com>
2014-05-12exynos: prime: use drmPrime*() helpersDaniel Kurtz1-38/+10
Reuse the common drmPrime() helper functions rather than reinventing them. Signed-off-by: Daniel Kurtz <djkurtz@chromium.org> Acked-by: Inki Dae <inki.dae@samsung.com>
2014-05-12exynos_fimg2d: fix cast from pointer to integer of different sizeDaniel Kurtz1-2/+2
Fixes two gcc [-Wpointer-to-int-cast] warnings. Signed-off-by: Daniel Kurtz <djkurtz@chromium.org> Acked-by: Inki Dae <inki.dae@samsung.com>
2014-05-12exynos: fix two warningsDaniel Kurtz1-2/+2
warning: assignment makes pointer from integer without a cast [enabled by default] warning: initialization makes integer from pointer without a cast [enabled by default] Signed-off-by: Daniel Kurtz <djkurtz@chromium.org> Acked-by: Inki Dae <inki.dae@samsung.com>
2013-03-27makefiles: Add missing headers.Maarten Lankhorst1-1/+5
I even compile time tested this on a panda with make dist! Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
2013-03-08libdrm/exynos: add test application for 2d gpu.Inki Dae5-1/+1122
This patch adds library and test application for g2d gpu(fimg2d). The fimg2d hardware is a 2D graphics accelerator(G2D) that supports Bit Block Transfer(BitBLT). The library includes the following primitive drawing operations: .solid fill - This operation fills the given buffer with the given color data. .copy - This operation copies contents in source buffer to destination buffer. .copy_with_scale - This operation copies contents in source buffer to destination buffer scaling up or down properly. .blend - This operation blends contents in source buffer with the ones in destination buffer. And the above operations uses gem handle or user space address allocated by malloc() as source or destination buffer. And the test application includes just simple primitive drawing tests with the above library. And the guide to test is as the following, "#exynos_fimg2d_test -s connector_id@crtc_id:mode" With this above simple command, four primitive drawing operations would be called step by step and also rendered on the output device to the given connector and crtc id. Signed-off-by: Inki Dae <inki.dae@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: Rob Clark <robdclark@gmail.com>
2012-07-06libdrm/exynos: padding gem_mmap structure to 64-bit alignedCooper Yuan1-1/+3
2012-05-12libdrm: add exynos drm supportInki Dae5-0/+663
this patch adds libdrm_exynos helper layer that inclues some intefaces for exynos specific gem and virtual display driver and also adds exynos module name to modtest and vbltest. Changelog v2: - fixed exynos broken ioctl. the pointer of uint64_t *edid should be removed. - removed unnecessary definitions. - added drm prime interfaces. this feature is used to share a buffer between drivers or memory managers and for this, please, refer to below links: http://www.mjmwired.net/kernel/Documentation/dma-buf-sharing.txt http://lwn.net/Articles/488664/ this patch is based on a link below: git://anongit.freedesktop.org/mesa/drm commit id: d72a44c7c4f5eea9c1e5bb0c36cb9e0224b9ca22 Reviewed-by: Rob Clark <rob@ti.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Inki Dae <inki.dae@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: Rob Clark <rob@ti.com>