summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/exynos/exynos_drm_ipp.c
AgeCommit message (Collapse)AuthorFilesLines
2017-03-21drm/exynos: Print kernel pointers in a restricted formKrzysztof Kozlowski1-11/+11
Printing raw kernel pointers might reveal information which sometimes we try to hide (e.g. with Kernel Address Space Layout Randomization). Use the "%pK" format so these pointers will be hidden for unprivileged users. Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2016-03-01drm/exynos: ipp: fix incorrect format specifiers in debug messagesMarek Szyprowski1-16/+16
Drivers should use %p for printing pointers instead of hardcoding them as hexadecimal integers. This patch fixes compilation warnings on 64bit architectures. Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2016-01-25drm: Create drm_send_event helpersDaniel Vetter1-5/+1
Use them in the core vblank code and exynos/vmwgfx drivers. Note that the difference between wake_up_all and _interruptible in vmwgfx doesn't matter since the only waiter is the core code in drm_fops.c. And that is interruptible. v2: Adjust existing kerneldoc too. Reviewed-by: Alex Deucher <alexander.deucher@amd.com> (v1) Acked-by: Daniel Stone <daniels@collabora.com> Cc: Alex Deucher <alexander.deucher@amd.com> Cc: Thomas Hellstrom <thellstrom@vmware.com> Cc: Inki Dae <inki.dae@samsung.com> Link: http://patchwork.freedesktop.org/patch/msgid/1452548477-15905-6-git-send-email-daniel.vetter@ffwll.ch Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> [danvet: Squash in compile fixup, spotted by 0-day.] Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2016-01-25drm/exynos: Use the new event init/free functionsDaniel Vetter1-14/+9
Also fixes a bug in IPP with not correctly checking/allocating for space in the event space. Not a too serious bug since it's not a real ringbuffer, just a limit to avoid too much kernel allocations. Cc: Rob Clark <robdclark@gmail.com> Cc: Inki Dae <inki.dae@samsung.com> Acked-by: Daniel Stone <daniels@collabora.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Link: http://patchwork.freedesktop.org/patch/msgid/1452548477-15905-4-git-send-email-daniel.vetter@ffwll.ch Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2015-08-16drm/exynos: remove unnecessary checking to support iommuJoonyoung Shim1-10/+6
Already drm_iommu_attach_device and drm_iommu_detach_device check whether support iommu internally, so we don't have to call is_drm_iommu_supported before call them. Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com> Tested-by: Marek Szyprowski <m.szyprowski@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2015-06-20drm/exynos: ipp: validate a GEM handle with multiple planesHyungwon Hwang1-13/+38
FIMC & GSC driver can calculate the offset of planes. So there are use cases which IPP receives just one GEM handle of an image with multiple plane. This patch extends ipp_validate_mem_node() to validate this case. Signed-off-by: Hyungwon Hwang <human.hwang@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2015-06-20drm/exynos: ipp: fix wrong index referencing a config elementHyungwon Hwang1-2/+1
Config depends on the opreation. So it must be referenced by an operation id, not a property id. Signed-off-by: Hyungwon Hwang <human.hwang@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2015-06-20drm/exynos: consolidate driver/device initialization codeAndrzej Hajda1-27/+0
Code registering different drivers and simple platform devices was dispersed across multiple sub-modules. This patch moves it to one place. As a result initialization code is shorter and cleaner and should simplify further development. Signed-off-by: Andrzej Hajda <a.hajda@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2015-04-13drm/exynos/ipp: Validate buffer enqueue requestsBeata Michalska1-0/+44
As for now there is no validation of incoming buffer enqueue request as far as the gem buffers are being concerned. This might lead to some undesired cases when the driver tries to operate on invalid buffers (wiht no valid gem object handle i.e.). Add some basic checks to rule out those potential issues. Signed-off-by: Beata Michalska <b.michalska@samsung.com> [mszyprow: rebased onto v4.0-rc1 and adapted to recent ipp changes] Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2014-11-24drm/exynos/ipp: fix error return codeJulia Lawall1-0/+3
Propagate the returned error code on failure. A simplified version of the semantic match that finds this problem is as follows: (http://coccinelle.lip6.fr/) // <smpl> @@ identifier ret; expression e1,e2; @@ ( if (\(ret < 0\|ret != 0\)) { ... return ret; } | ret = 0 ) ... when != ret = e1 when != &ret *if(...) { ... when != ret = e2 when forall return ret; } // </smpl> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2014-09-20drm/exynos/ipp: traverse ipp drivers list safelyAndrzej Hajda1-2/+2
On ipp subsystem removal list of ipp drivers is traversed and their members are deleted. To do it properly safe version of list_for_each* should be used. Signed-off-by: Andrzej Hajda <a.hajda@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2014-09-20drm/exynos/ipp: add file checks for ioctlsAndrzej Hajda1-47/+22
Process should not have access to ipp nodes created by another process. The patch adds necessary checks. It also simplifies lookup for command node. Signed-off-by: Andrzej Hajda <a.hajda@samsung.com> Reviewed-by: Joonyoung Shim <jy0922.shim@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2014-09-20drm/exynos/ipp: remove file argument from node related functionsAndrzej Hajda1-7/+5
Since file pointer is preserved in c_node passing it as argument in node functions is redundant. Signed-off-by: Andrzej Hajda <a.hajda@samsung.com> Reviewed-by: Joonyoung Shim <jy0922.shim@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2014-09-20drm/exynos/ipp: remove events during command cleaningAndrzej Hajda1-77/+78
Events were removed only during stop command, as a result there were memory leaks if program prematurely exited. This patch fixes it. Signed-off-by: Andrzej Hajda <a.hajda@samsung.com> Reviewed-by: Joonyoung Shim <jy0922.shim@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2014-09-20drm/exynos/ipp: stop hardware before freeing memoryAndrzej Hajda1-9/+6
Memory shouldn't be freed when hardware is still running. Signed-off-by: Andrzej Hajda <a.hajda@samsung.com> Reviewed-by: Joonyoung Shim <jy0922.shim@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2014-09-20drm/exynos/ipp: replace work_struct casting with better constructsAndrzej Hajda1-3/+3
Type casting should be avoided if possible. In case of work_struct it can be simply replaced by reference to member field. Signed-off-by: Andrzej Hajda <a.hajda@samsung.com> Reviewed-by: Joonyoung Shim <jy0922.shim@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2014-09-20drm/exynos/ipp: clean memory nodes on command node cleaningAndrzej Hajda1-0/+5
The nodes should be removed before removing command node. Signed-off-by: Andrzej Hajda <a.hajda@samsung.com> Reviewed-by: Joonyoung Shim <jy0922.shim@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2014-09-20drm/exynos/ipp: move nodes cleaning to separate functionAndrzej Hajda1-123/+106
The patch introduces ipp_clean_mem_nodes function which replaces redundant code. Additionally memory node function definitions are moved up to increase its visibility. Signed-off-by: Andrzej Hajda <a.hajda@samsung.com> Reviewed-by: Joonyoung Shim <jy0922.shim@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2014-09-20drm/exynos/ipp: free partially allocated resources on errorAndrzej Hajda1-35/+32
In case of allocation errors some already allocated buffers were not freed. The patch fixes it. Signed-off-by: Andrzej Hajda <a.hajda@samsung.com> Reviewed-by: Joonyoung Shim <jy0922.shim@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2014-09-20drm/exynos/ipp: remove unused field in command nodeAndrzej Hajda1-1/+0
Since command node have file pointer dev field became useless. Signed-off-by: Andrzej Hajda <a.hajda@samsung.com> Reviewed-by: Joonyoung Shim <jy0922.shim@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2014-09-20drm/exynos/ipp: remove only related commands on file closeAndrzej Hajda1-4/+1
On file close driver should remove only command nodes created via this file. Signed-off-by: Andrzej Hajda <a.hajda@samsung.com> Reviewed-by: Joonyoung Shim <jy0922.shim@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2014-09-20drm/exynos/ipp: move file reference from memory to command nodeAndrzej Hajda1-3/+2
Command node should contain file reference to distinguish commands created by different processes. Signed-off-by: Andrzej Hajda <a.hajda@samsung.com> Reviewed-by: Joonyoung Shim <jy0922.shim@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2014-09-20drm/exynos/ipp: cancel works before command node cleanAndrzej Hajda1-0/+5
All pending works should be canceled prior to its removal. Signed-off-by: Andrzej Hajda <a.hajda@samsung.com> Reviewed-by: Joonyoung Shim <jy0922.shim@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2014-09-20drm/exynos/ipp: remove fake pm callbacksAndrzej Hajda1-51/+0
PM callbacks in ipp core do nothing, so the patch removes it. Signed-off-by: Andrzej Hajda <a.hajda@samsung.com> Reviewed-by: Joonyoung Shim <jy0922.shim@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2014-08-03drm/exynos/ipp: simplify ipp_find_driverAndrzej Hajda1-53/+21
The patch puts repeated code sequence into one function, removes verbose comments and decreases log verbosity. Signed-off-by: Andrzej Hajda <a.hajda@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2014-08-03drm/exynos/ipp: simplify ipp_create_idAndrzej Hajda1-19/+9
There is no gain in passing id by pointer to be filled. Signed-off-by: Andrzej Hajda <a.hajda@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2014-08-03drm/exynos/ipp: remove redundant messagesAndrzej Hajda1-11/+4
In case of error callback prints already corresponding message. Signed-off-by: Andrzej Hajda <a.hajda@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2014-08-03drm/exynos/ipp: simplify ipp_find_objAndrzej Hajda1-18/+8
The patch simplifies ipp_find_obj and removes debug messages. Signed-off-by: Andrzej Hajda <a.hajda@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2014-08-03drm/exynos/ipp: remove useless registration checksAndrzej Hajda1-6/+0
Argument checks are redundant, clients always check ippdrv before calling these functions. Signed-off-by: Andrzej Hajda <a.hajda@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2014-08-03drm/exynos/ipp: simplify memory check functionAndrzej Hajda1-34/+10
The only thing function should check is if there are buffers in respective queues. Signed-off-by: Andrzej Hajda <a.hajda@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2014-08-03drm/exynos/ipp: remove incorrect checks of list_first_entry resultAndrzej Hajda1-15/+0
list_first_entry does not return NULL on empty list so this check does not make sense. Moreover there is already code which prevents calling list_first_entry on empty lists. Signed-off-by: Andrzej Hajda <a.hajda@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2014-08-03drm/exynos/ipp: remove temporary variableAndrzej Hajda1-8/+6
There is no reason to allocate intermediate variable. Signed-off-by: Andrzej Hajda <a.hajda@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2014-08-03drm/exynos/ipp: correct address typeAndrzej Hajda1-2/+3
exynos_drm_gem_get_dma_addr returns dma_addr_t, type casting to void* and back is not necessary. Signed-off-by: Andrzej Hajda <a.hajda@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2014-08-03drm/exynos/ipp: remove struct exynos_drm_ipp_privateAndrzej Hajda1-21/+9
struct exynos_drm_ipp_private contains only one pointer so all occurrences of the struct can be replaced by the pointer itself. Signed-off-by: Andrzej Hajda <a.hajda@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2014-08-03drm/exynos/ipp: remove unused field from exynos_drm_ipp_privateAndrzej Hajda1-2/+0
The patch removes unused event_list field from struct exynos_drm_ipp_private. Signed-off-by: Andrzej Hajda <a.hajda@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2014-08-03drm/exynos/ipp: remove type castingAndrzej Hajda1-1/+1
The patch replaces type casting with proper pointer. Signed-off-by: Andrzej Hajda <a.hajda@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2014-06-12Merge branch 'drm-next' of git://people.freedesktop.org/~airlied/linuxLinus Torvalds1-127/+131
Pull drm updates from Dave Airlie: "This is the main drm merge window pull request, changes all over the place, mostly normal levels of churn. Highlights: Core drm: More cleanups, fix race on connector/encoder naming, docs updates, object locking rework in prep for atomic modeset i915: mipi DSI support, valleyview power fixes, cursor size fixes, execlist refactoring, vblank improvements, userptr support, OOM handling improvements radeon: GPUVM tuning and large page size support, gart fixes, deep color HDMI support, HDMI audio cleanups nouveau: - displayport rework should fix lots of issues - initial gk20a support - gk110b support - gk208 fixes exynos: probe order fixes, HDMI changes, IPP consolidation msm: debugfs updates, misc fixes ast: ast2400 support, sync with UMS driver tegra: cleanups, hdmi + hw cursor for Tegra 124. panel: fixes existing panels add some new ones. ipuv3: moved from staging to drivers/gpu" * 'drm-next' of git://people.freedesktop.org/~airlied/linux: (761 commits) drm/nouveau/disp/dp: fix tmds passthrough on dp connector drm/nouveau/dp: probe dpcd to determine connectedness drm/nv50-: trigger update after all connectors disabled drm/nv50-: prepare for attaching a SOR to multiple heads drm/gf119-/disp: fix debug output on update failure drm/nouveau/disp/dp: make use of postcursor when its available drm/g94-/disp/dp: take max pullup value across all lanes drm/nouveau/bios/dp: parse lane postcursor data drm/nouveau/dp: fix support for dpms drm/nouveau: register a drm_dp_aux channel for each dp connector drm/g94-/disp: add method to power-off dp lanes drm/nouveau/disp/dp: maintain link in response to hpd signal drm/g94-/disp: bash and wait for something after changing lane power regs drm/nouveau/disp/dp: split link config/power into two steps drm/nv50/disp: train PIOR-attached DP from second supervisor drm/nouveau/disp/dp: make use of existing output data for link training drm/gf119/disp: start removing direct vbios parsing from supervisor drm/nv50/disp: start removing direct vbios parsing from supervisor drm/nouveau/disp/dp: maintain receiver caps in response to hpd signal drm/nouveau/disp/dp: create subclass for dp outputs ...
2014-06-02drm/exynos: ipp: rearrange c_node->event_lock using routineYoungJun Cho1-11/+14
The c_node->event_list should be protected with c_node->event_lock. Signed-off-by: YoungJun Cho <yj44.cho@samsung.com> Acked-by: Seong-Woo Kim <sw0312.kim@samsung.com> Acked-by: Kyungmin Park <kyungmin.park@samsung.com> Tested-by: Andrzej Hajda <a.hajda@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2014-06-02drm/exynos: ipp: rearrange c_node->mem_lock using routinesYoungJun Cho1-38/+48
The c_node->mem_list[] should be protected with c_node->mem_lock. Signed-off-by: YoungJun Cho <yj44.cho@samsung.com> Acked-by: Seong-Woo Kim <sw0312.kim@samsung.com> Acked-by: Kyungmin Park <kyungmin.park@samsung.com> Tested-by: Andrzej Hajda <a.hajda@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2014-06-02drm/exynos: ipp: add ipp_remove_id()YoungJun Cho1-11/+31
This patch adds ipp_remove_id() for idr resource free. Signed-off-by: YoungJun Cho <yj44.cho@samsung.com> Acked-by: Seong-Woo Kim <sw0312.kim@samsung.com> Acked-by: Kyungmin Park <kyungmin.park@samsung.com> Tested-by: Andrzej Hajda <a.hajda@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2014-06-02drm/exynos: ipp: add cmd_lock for cmd_listYoungJun Cho1-2/+18
This patch adds cmd_lock for cmd_list synchronization. Signed-off-by: YoungJun Cho <yj44.cho@samsung.com> Acked-by: Seong-Woo Kim <sw0312.kim@samsung.com> Acked-by: Kyungmin Park <kyungmin.park@samsung.com> Tested-by: Andrzej Hajda <a.hajda@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2014-06-02drm/exynos: ipp: rename cmd_lock to lockYoungJun Cho1-6/+6
The ippdrv->cmd_list requires cmd_lock. So renames cmd_lock to lock for context. Signed-off-by: YoungJun Cho <yj44.cho@samsung.com> Acked-by: Seong-Woo Kim <sw0312.kim@samsung.com> Acked-by: Kyungmin Park <kyungmin.park@samsung.com> Tested-by: Andrzej Hajda <a.hajda@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2014-06-02drm/exynos: ipp: remove duplicated settingYoungJun Cho1-1/+1
This patch removes duplicated setting. Signed-off-by: YoungJun Cho <yj44.cho@samsung.com> Acked-by: Seong-Woo Kim <sw0312.cho@samsung.com> Acked-by: Kyungmin Park <kyungmin.park@samsung.com> Tested-by: Andrzej Hajda <a.hajda@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2014-06-02drm/exynos: ipp: remove usless list_empty() functionsYoungJun Cho1-52/+9
list_for_each_entry() handles empty lists, so there is no need to check whether the list is empty first. Signed-off-by: YoungJun Cho <yj44.cho@samsung.com> Acked-by: Seong-Woo Kim <sw0312.kim@samsung.com> Acked-by: Kyungmin Park <kyungmin.park@samsung.com> Tested-by: Andrzej Hajda <a.hajda@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2014-06-02drm/exynos/ipp: simplify property list allocationAndrzej Hajda1-2/+2
prop_list is always allocated, so instead of allocating it dynamically the pointer can be replaced by the structure itself. Signed-off-by: Andrzej Hajda <a.hajda@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2014-06-02drm/exynos/ipp: correct ipp_id field initializationAndrzej Hajda1-8/+6
prop_list.ipp_id field is not initialized properly. The patch fixes it, additionally it removes redundant field from ippdrv. Signed-off-by: Andrzej Hajda <a.hajda@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2014-06-02drm/exynos/ipp: fix get_property IOCTLAndrzej Hajda1-1/+1
Due to incorrect assignment in EXYNOS_IPP_GET_PROPERTY IOCTL handler this IOCTL did not work at all. The patch fixes it. Signed-off-by: Andrzej Hajda <a.hajda@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2014-05-05drm/exynos: Spelling s/contro/control/Geert Uytterhoeven1-1/+1
Signed-off-by: Geert Uytterhoeven <geert+renesas@linux-m68k.org> Cc: David Airlie <airlied@linux.ie> Cc: dri-devel@lists.freedesktop.org Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2014-02-07drm/exynos: Fix trivial typoSachin Kamat1-1/+1
Changed quf -> qbuf. Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2014-02-07drm/exynos: Fix multiplatform breakage for ipp/gscTushar Behera1-1/+0
There is no need to include "plat/map-base.h" in ipp driver. Remove this and enable this driver for multi-platform. However gsc driver is not multiplatform compliant yet, so make the compilation conditional upon !ARCH_MULTIPLATFORM. Signed-off-by: Tushar Behera <tushar.behera@linaro.org> Signed-off-by: Inki Dae <inki.dae@samsung.com>