Cho KyongHo [Tue, 11 Oct 2016 11:19:38 +0000 (20:19 +0900)]
[COMMON] media: scaler: add explict cache maintenance
m2m1shot now provides m2m1shot_sync_for_device/cpu() functions that
explicitly cleaning or invalidating CPU caches. This patch follows
"media: m2m1shot: use exynos_iovmm_map_userptr()" which separate
cache maintenance from m2m1shot_map/unmap_dma_buf().
Change-Id: I8eac9cf955fff3f07aa00a6ea86f401245e21be3
Signed-off-by: Cho KyongHo <pullip.cho@samsung.com>
Janghyuck Kim [Mon, 21 Aug 2017 02:33:25 +0000 (11:33 +0900)]
[COMMON] media: scaler: add reset sequence for scaler 5.0.1
Change-Id: Iedfb4b3a0ac1b544ad62e2da062c4cab547f00b1
Signed-off-by: Janghyuck Kim <janghyuck.kim@samsung.com>
Janghyuck Kim [Wed, 16 Aug 2017 05:10:24 +0000 (14:10 +0900)]
[COMMON] media: scaler: add minor version information
Change-Id: I3e20742826a69c72fe87bb92b3e02c1ca15a0b27
Signed-off-by: Janghyuck Kim <janghyuck.kim@samsung.com>
Janghyuck Kim [Wed, 21 Jun 2017 08:31:12 +0000 (17:31 +0900)]
[COMMON] media: scaler: 10bit size calculation for V4L2_PIX_FMT_NV12N_10B
V4L2_PIX_FMT_NV12N_10B was missed for 10bit size calculation.
Change-Id: I6cb0582ae7e00b5c91a9362e9bd9b35603def47b
Signed-off-by: Janghyuck Kim <janghyuck.kim@samsung.com>
Janghyuck Kim [Tue, 30 May 2017 06:33:36 +0000 (15:33 +0900)]
[COMMON] media: scaler: add context dump for debugging
This patch added information of context that can be useful for
unexpected error case.
Change-Id: I826634b4220ae9a12d9be9fdbbab26908f2333a2
Signed-off-by: Janghyuck Kim <janghyuck.kim@samsung.com>
Janghyuck Kim [Sat, 15 Jul 2017 10:55:22 +0000 (19:55 +0900)]
[COMMON] media: scaler: add devfreq setting
S_CTRL for framerate setting is added.
If user setting framerate of context, it is considered that pm qos lock
is required to guarantee scaler performance. User can remove pm qos lock
by setting framerate as zero explicitly, or it can be removed
automatically if context is closed.
Change-Id: I8e24e0f7ad24e1ed2fed2cc80a8c35495c32a531
Signed-off-by: Janghyuck Kim <janghyuck.kim@samsung.com>
Janghyuck Kim [Mon, 19 Jun 2017 12:15:05 +0000 (21:15 +0900)]
[COMMON] media: scaler: get rid of padding for 2bit CbCr
In case of S10B pixel format, padding bytes for 2bit CbCr does not
necessary.
Change-Id: I66fd0197c53690beb1d94e5315eea5c0b6ec88b1
Signed-off-by: Janghyuck Kim <janghyuck.kim@samsung.com>
Janghyuck Kim [Mon, 12 Jun 2017 13:01:30 +0000 (22:01 +0900)]
[HACK] media: scaler: add extra size for source buffer
Change-Id: Ie54f0c1b897943109e0ddc84cd3f7c66b047cf16
Signed-off-by: Janghyuck Kim <janghyuck.kim@samsung.com>
Janghyuck Kim [Sat, 6 May 2017 08:50:19 +0000 (17:50 +0900)]
[COMMON] media: scaler: support 10bit pixel format
This patch supports 10bit pixel format that listed in below.
V4L2_PIX_FMT_NV12M_S10B
V4L2_PIX_FMT_NV12M_P010
V4L2_PIX_FMT_NV16M_S10B
V4L2_PIX_FMT_NV61M_S10B
Change-Id: Idabb2476333add13b895ef0725211df0a23dec0f
Signed-off-by: Janghyuck Kim <janghyuck.kim@samsung.com>
Janghyuck Kim [Sat, 6 May 2017 09:09:33 +0000 (18:09 +0900)]
[COMMON] media: scaler: move ion_client from int_frame to dev
ion_client is used for internal buffer allocation, but it would be
complicated and hard to manage when it is used for int_frame and
mid_buf. So it is moved to sc_dev.
Change-Id: Ie16119f2871246d0dc886b31d27d689197e50ca4
Signed-off-by: Janghyuck Kim <janghyuck.kim@samsung.com>
Janghyuck Kim [Fri, 28 Apr 2017 12:45:33 +0000 (21:45 +0900)]
[COMMON] media: scaler: cleaning up buffer allocation related code
This patch cleans up repetitive code for plane size calculation and
buffer allocation and free of intermediate buffer.
How to calculate plane size varies depending on the pixel format
conditions, however, many repetitive code was used. Common calculation
code is separated by one function.
Intermediate buffer allocation was repetitive and easy to mistake. It is
cleaned up by changing sc_addr structure to use array. It contains
removing redundant code for prefetch buffer.
Change-Id: Iea75d7f204e0addcebfc187b96eb8466320e5fd9
Signed-off-by: Janghyuck Kim <janghyuck.kim@samsung.com>
Janghyuck Kim [Sat, 6 May 2017 07:31:19 +0000 (16:31 +0900)]
[COMMON] media: scaler: update coef table for 10bit processing
Scaler coef table values are updated because 10bit pixelformat support
accompanied valid bit extension for coefficient value.
Change-Id: Ibde9ad8bdc1f95856021f40e1ce67c11e3485c03
Signed-off-by: Janghyuck Kim <janghyuck.kim@samsung.com>
Janghyuck Kim [Fri, 19 May 2017 02:17:01 +0000 (11:17 +0900)]
[COMMON] media: scaler: remove csc table for DCI-P3
csc table for DCI-P3 is not used.
Change-Id: I2fed0147641f1b37dc97d5395342a56f743bcba9
Signed-off-by: Janghyuck Kim <janghyuck.kim@samsung.com>
Janghyuck Kim [Sat, 6 May 2017 05:36:17 +0000 (14:36 +0900)]
[COMMON] media: scaler: add scaler version 5.0
Change-Id: Ic3c6a0f6fe40cf6b79af69cbb05bb53758aebe24
Signed-off-by: Janghyuck Kim <janghyuck.kim@samsung.com>
woncheon.an [Thu, 30 Mar 2017 10:35:05 +0000 (19:35 +0900)]
[COMMON] media: scaler: support 960p dnoise filter
Change-Id: Iba96e068f7b9da2faba24aa171a701366034cd5c
Signed-off-by: woncheon.an <woncheon.an@samsung.com>
woncheon.an [Mon, 13 Feb 2017 06:42:32 +0000 (15:42 +0900)]
[COMMON] media: scaler: add debugging log for g2d power domain
We get the channel information before suspend resume callback to
debug the hw state.
Change-Id: I395a8fa01209e209a3e36ac9b7d75e7adc4117ee
Signed-off-by: woncheon.an <woncheon.an@samsung.com>
woncheon.an [Mon, 6 Feb 2017 08:07:43 +0000 (17:07 +0900)]
[COMMON] media: scaler: delete unnecessary check code
Minumum size of Src is 16x16 and minimum size of Dst is 4x4.
So deleted check code is always false
Therefore Src->Dst scaling ratio check code is unnecessary
Change-Id: I383e0765a4db33ff337fb675c07e145c4ca5ec37
Signed-off-by: woncheon.an <woncheon.an@samsung.com>
Cho KyongHo [Thu, 26 Jan 2017 06:32:17 +0000 (15:32 +0900)]
[COMMON] media: scaler: fix buffer free during working
Scaler driver is able to run H/W twice to support the users who want
to zoom out the given image by the larger minification factor than the
factor H/W supports. It is called pre-scaling and pre-scaling requires
a temporary buffer that is not supplied by the users but allocaged by
Scaler driver itself.
Scaler driver allocates the buffer when it finds that pre-scaling is
required and frees when it notices that the pre-scaling is not needed
any more. However the driver has a flaw of logic in sc_release() that
releases the temporary buffer before waiting for the H/W to be done.
It results in accessing a freed buffer by H/W.
Change-Id: I951de839884382b9806a744aac92ec4d083fa689
Signed-off-by: Cho KyongHo <pullip.cho@samsung.com>
woncheon.an [Wed, 1 Feb 2017 11:35:41 +0000 (20:35 +0900)]
[COMMON] media: scaler: modify minimum size check condition.
There's possibility that intermediate frame size violate to
minimum input size during 2nd operation. but previous code
can't check about minumum size restirction if ratio conditional sentence is false
So intermediate frame size check codes are moved backward
Change-Id: Icf0d01571037dc5f4c95c1acc66db1704370c9d1
Signed-off-by: woncheon.an <woncheon.an@samsung.com>
Cho KyongHo [Mon, 9 Jan 2017 08:29:12 +0000 (17:29 +0900)]
[COMMON] media: scaler: fix possible clk enable after shutdown
sc_shutdown() is called during system shutdown and it marks drvdata
that it is under shutdown state. However, a task is requested to be
processed after sc_shutdown() is called, sc_run_next_job() enables
the power and the clocks of Scaler even though the power domain is
already detached.
Change-Id: Ib90ac0d870a381a4e3a99455a749ff42ff0d5565
Signed-off-by: Cho KyongHo <pullip.cho@samsung.com>
Won Jung [Fri, 6 Jan 2017 01:26:02 +0000 (10:26 +0900)]
[COMMON] media: scaler: fix power-off bug for scaler
There is a possibility which g2d block power off
while scaler is running. A scaler is in the g2d block.
In interrupt handler, rm_runtim functions, pm_runtime_get
or pm_runtime_put, are uesed as asynchronous mode.
But since a wating job can be called in interrupt handler,
g2d block power is turned off due to the asyncchronous
pm_runtime_put function while the job is performing.
Therefore, the pm_runtime_put should be called after
the wating job which performs in irq handler is done.
Change-Id: If342b2cc4b57714d6183486b4b54b1b21b1c1472
Signed-off-by: Won Jung <w00.jung@samsung.com>
Cho KyongHo [Wed, 28 Dec 2016 14:17:15 +0000 (23:17 +0900)]
[COMMON] media: scaler: wait device stop running locklessly
Since "
fec3dab [8895] media: scaler: add mutex lock" patch has been
applied, the following problem is reported:
BUG: sleeping function called from invalid context at kernel/locking/mutex.c:617
in_atomic(): 1, irqs_disabled(): 128, pid: 0, name: swapper/0
CPU: 0 MPIDR:
80000100 PID: 0 Comm: swapper/0 Tainted: G W 4.4.13-
10228462-eng #1
Hardware name: Samsung SM-G955F rev00 board based on EXYNOS8895 (DT)
Call trace:
[<
ffffffc00008a254>] dump_backtrace+0x0/0x110
[<
ffffffc00008a378>] show_stack+0x14/0x20
[<
ffffffc0003892b4>] dump_stack+0xa8/0xe4
[<
ffffffc0000d5220>] ___might_sleep+0x244/0x258
[<
ffffffc0000d52ac>] __might_sleep+0x78/0x8c
[<
ffffffc000c240ec>] mutex_lock_nested+0x3c/0x3bc
[<
ffffffc00075490c>] sc_m2m1shot_device_run+0x30/0xd4
[<
ffffffc000746b74>] m2m1shot_task_schedule+0x90/0xd8
[<
ffffffc00074735c>] m2m1shot_task_finish+0x78/0x90
[<
ffffffc000752338>] sc_irq_handler+0x4a4/0x4f4
[<
ffffffc00010b84c>] handle_irq_event_percpu+0x15c/0x418
[<
ffffffc00010bb4c>] handle_irq_event+0x44/0x78
[<
ffffffc00010ef04>] handle_fasteoi_irq+0xc4/0x138
[<
ffffffc00010af80>] generic_handle_irq+0x1c/0x30
[<
ffffffc00010b060>] __handle_domain_irq+0xcc/0x11c
[<
ffffffc0000814f8>] gic_handle_irq+0x70/0xcc
It is caused by the mutex lock introduced by the above patch and the
mutex is required for modifying DEV_SUSPEND and testing DEV_RUN
atomically.
However, the problem that a new task starts running between testing
DEV_SUSPEND and testing DEV_RUN in sc_suspend() and sc_shutdown() is
basically caused by the sc_irq_handler() that clears DEV_RUN before
testing DEV_SUSPEND. Therefore, the problem of running an unexpected
task is simply solved by moving clearing DEV_RUN after testing
DEV_SUSPEND.
Change-Id: I7deed59fc636868d062a63ba8c5b2bd5b9f3c753
Signed-off-by: Cho KyongHo <pullip.cho@samsung.com>
Won Jung [Thu, 1 Dec 2016 02:12:20 +0000 (11:12 +0900)]
[COMMON] media: scaler: modify BT709 narrow csc coef. value
Change-Id: I499bdb052680ef019364c196887a7b45a5b3140e
Signed-off-by: Won Jung <w00.jung@samsung.com>
Won Jung [Wed, 21 Sep 2016 08:34:07 +0000 (17:34 +0900)]
[COMMON] media: scaler: add the shutdown callback
if shutdown, scaler driver should wait to finish the H/W
operation to avoid the access the power domain/ clk
after the detach of pm_domain
Change-Id: I7a2367ff02faf7355d11b9ca23661bb6e3ec8629
Signed-off-by: Won Jung <w00.jung@samsung.com>
Won Jung [Mon, 22 Aug 2016 07:57:43 +0000 (16:57 +0900)]
[COMMON] media: scaler: modify codes for size align
Modify codes for size align. This work is for yuv422
and yuv420 formats. In the formats, must be set
as an even number.
Change-Id: I0925f1592244bf79dfc421f8c3f27bfd48180a20
Signed-off-by: Won Jung <w00.jung@samsung.com>
Won Jung [Fri, 19 Aug 2016 11:56:59 +0000 (20:56 +0900)]
[COMMON] media: scaler: add swrst in case of errors
add swrset to go into power down mode if error
is asserted
Change-Id: Ib098c1856185df9514378f5b2b151a5c182bfe57
Signed-off-by: Won Jung <w00.jung@samsung.com>
Won Jung [Wed, 3 Aug 2016 06:17:44 +0000 (15:17 +0900)]
[COMMON] media: scaler: Remove smc call for cfw
Do not need smc call for cfw in KC
Change-Id: Ibc546cecfd3340d5da076659e23f858ed5b8dd05
Signed-off-by: Won Jung <w00.jung@samsung.com>
Won Jung [Thu, 21 Jul 2016 05:32:52 +0000 (14:32 +0900)]
[COMMON] media: scaler: add double scaling feature
For scaling up/down over the constraints, scaler driver
performs double scaling. Moreover, it supports drm play.
Change-Id: Id0e7b8f71754a9423432acced67a9bf4269101ff
Signed-off-by: Won Jung <w00.jung@samsung.com>
Won Jung [Tue, 21 Jun 2016 01:12:40 +0000 (10:12 +0900)]
[COMMON] media: scaler: add scaler version
add scaler version (4.0.1) due to hw version change.
Change-Id: Ic64b1723cdffd51cfcc4e181c040ff92d5e8ff3a
Signed-off-by: Won Jung <w00.jung@samsung.com>
haksong [Thu, 19 May 2016 07:23:20 +0000 (16:23 +0900)]
[COMMON] media: scaler: add scaler driver for kernel 4.9
Change-Id: I8be3927f6d21f8bdb51a42160c148caf474a57fc
Signed-off-by: Janghyuck Kim <janghyuck.kim@samsung.com>
Cho KyongHo [Mon, 12 Feb 2018 05:25:35 +0000 (14:25 +0900)]
media: m2m1shot: fix ion header file
ION is dramatically changed in 4.14 kernel including header file name.
Change-Id: Ie224ea1718b55000696b081e22643e4ca19ecc46
Signed-off-by: Cho KyongHo <pullip.cho@samsung.com>
Cho KyongHo [Thu, 23 Nov 2017 08:21:08 +0000 (17:21 +0900)]
[COMMON] media: m2m1shot: fix implicit type conversion
Prevent CID: 201932
Change-Id: I506141fee3de6d9d4e62b83ab4211bdf84a3c366
Signed-off-by: Cho KyongHo <pullip.cho@samsung.com>
Cho KyongHo [Mon, 10 Oct 2016 14:23:54 +0000 (23:23 +0900)]
[COMMON] media: m2m1shot: use exynos_iovmm_map_userptr()
Pinning user buffer with get_user_pages() is very time-consuming.
Discard using get_user_pages() and get benefit from
exynos_iovmm_map_userptr().
Change-Id: I68c5a2c082d18e930cbc4908914d1af4e19ab7a0
Signed-off-by: Cho KyongHo <pullip.cho@samsung.com>
haksong [Thu, 19 May 2016 07:55:37 +0000 (16:55 +0900)]
[COMMON] media: add m2m1shot files for kernel 4.9
Change-Id: I9e59f47b5996fa91775245f8a63c661e2cabae55
Signed-off-by: haksong <haksong@samsung.com>
Cho KyongHo [Fri, 18 May 2018 03:12:18 +0000 (12:12 +0900)]
[9610] g2d: add support for Exynos9610
The features of G2D of Exynos9610 is the same as Exynos9810 except
supporting source layers.
Change-Id: Ia5b69fd25b5ab02c742a8ec71eafc4fe601ead3a
Signed-off-by: Cho KyongHo <pullip.cho@samsung.com>
Cho KyongHo [Wed, 11 Apr 2018 07:39:03 +0000 (16:39 +0900)]
g2d: add support for YCbCr 10-bit of Exynos9820
YCbCr 10-bit configuration to REG_LAYERX_COLORMODE of exynos9820 is
different from exynos9810. Since G2D driver uses the values to the
register as color format values, changes in the bitfields of
REG_LAYERX_COLORMODE also impacts to color format values.
Change-Id: I7e6bb03601db3aa3e34316a51070abd92d878832
Signed-off-by: Cho KyongHo <pullip.cho@samsung.com>
hyesoo.yu [Thu, 29 Mar 2018 04:18:58 +0000 (13:18 +0900)]
[COMMON] g2d: fix build error on clang
Change-Id: I504dd9670d9374d62b8482cf6f12d9686591b781
Signed-off-by: hyesoo.yu <hyesoo.yu@samsung.com>
Cho KyongHo [Tue, 13 Mar 2018 05:42:30 +0000 (14:42 +0900)]
g2d: improve readability of cmd alignment check
The number of commands in a command list should be a multiple of 8.
Calculating of the remainder of the division of the number of commands
by 8 and adding dummy commands as many as the remainder is not that
intuitive.
Change-Id: I15134fd06be7ff71236c283369c9041b5e954977
Signed-off-by: Cho KyongHo <pullip.cho@samsung.com>
Cho KyongHo [Sat, 17 Mar 2018 12:37:50 +0000 (21:37 +0900)]
g2d: add debugfs node about states of tasks
When G2D driver is not able to allocate a free task, we are curious
about the states of each task. debugs/g2d/tasks shows details of all
tasks including flags, state flags, priority and the time of starting
job and the time of the completion of the job.
Change-Id: I617f98169daaaca851bfd7c0dc52245ab96c624d
Signed-off-by: Cho KyongHo <pullip.cho@samsung.com>
Cho KyongHo [Mon, 12 Mar 2018 13:08:26 +0000 (22:08 +0900)]
g2d: improve readability of debugfs/g2d/logs
It is very difficult to understand logs of debugfs/g2d/logs because
it is not human readable. The log is transformed for humans:
before:
[ 0] 4:15@1 (0x 4) 0
45742336
[ 1] 4:15@2 (0x 4) 1
45743711
[ 2] 4: 0@0 (0x 0) 0
45743948
[ 3] 4:15@3 (0x10) 251
45743964
[ 4] 0: 0@4 (0x 0) 32768
45744660
[ 5] 0:15@5 (0x10) 697
45744664
[ 6] 4:15@1 (0x 0) 1
45745184
[ 7] 0: 0@0 (0x 0) 1
45747519
after:
[2:
77250240] task_alloc: JOB ID 15 (STATE 0x004) - alloc
[2:
77252363] task_begin: JOB ID 15 (STATE 0x004) - 1
[2:
77253063] runtime_pm: in
[2:
77253087] task_push: JOB ID 15 (STATE 0x010) - 722 usec.
[0:
77253791] irq: 0x8000
[0:
77253795] task_done: JOB ID 15 (STATE 0x010) - 705 usec.
[0:
77254048] runtime_pm: out
[2:
77254610] task_alloc: JOB ID 15 (STATE 0x000) - free
Change-Id: I6d0a735f259f86ecaa90abba662ec49727460524
Signed-off-by: Cho KyongHo <pullip.cho@samsung.com>
Cho KyongHo [Tue, 13 Mar 2018 05:37:42 +0000 (14:37 +0900)]
g2d: change layer security setting
Initialization of the regster at 0x30 guarantees G2D working correctly
on both of Exynos9810 and Exynos9820. On the other hand, initialzing
the register at 0x34 effects nothing.
Change-Id: I015ce6f7e873e10527d02a318010d004c66e2ed3
Signed-off-by: Cho KyongHo <pullip.cho@samsung.com>
Cho KyongHo [Thu, 30 Nov 2017 15:30:44 +0000 (00:30 +0900)]
g2d: add debugfs node of details of open contexts
Change-Id: Ic9cf4c397cbc2815223a536c0a1e125a22737210
Signed-off-by: Cho KyongHo <pullip.cho@samsung.com>
Cho KyongHo [Fri, 1 Dec 2017 04:59:12 +0000 (13:59 +0900)]
g2d: add error log when no free task slot found
Change-Id: I28d4af981117a26f45b90137338fe7045bc879e4
Signed-off-by: Cho KyongHo <pullip.cho@samsung.com>
Cho KyongHo [Thu, 30 Nov 2017 15:40:51 +0000 (00:40 +0900)]
g2d: add log of execution failure by priority
Change-Id: Ie6648726506be751fc4b9a03c6e374ae3c8c9b64
Signed-off-by: Cho KyongHo <pullip.cho@samsung.com>
Cho KyongHo [Mon, 5 Mar 2018 08:00:47 +0000 (17:00 +0900)]
g2d: add support for Secure DRM of Exynos9820
Protected contents of Secure DRM are processed by G2D if post image
prosessing is needed. G2D in Exynos9810 needs help of the secure world
due to the lack of prevention of protected contents leak to non-secure
world.
G2D in Exynos9820 does not need the help of the secure world because
it is guaranteed that G2D does not leak the protected contents.
Change-Id: I11028c774fe8b59cd21f7c6f391ae1949fd78767
Signed-off-by: Cho KyongHo <pullip.cho@samsung.com>
Cho KyongHo [Mon, 5 Mar 2018 06:55:56 +0000 (15:55 +0900)]
g2d: remove conditional compile for Secure DRM
CONFIG_EXYNOS_CONTENT_PATH_PROTECTION is defined when Secure DRM is
ready. Statements that depend on CONFIG_EXYNOS_CONTENT_PATH_PROTECTION
are split by #ifdef for the selective compilation.
But the conditional compilation makes code readers hard to understand
the source code and therefore easy to make mistakes during maintenance
of the source code.
Conditional compilation by CONFIG_EXYNOS_CONTENT_PATH_PROTECTION is
also needed to be removed for G2D of Exynos9820 that does not rely on
the secure world to run both of secure and non-secure G2D jobs.
Change-Id: I097c6ab051f8c3cdefdc6a84a9509d94c2f3149d
Signed-off-by: Cho KyongHo <pullip.cho@samsung.com>
Cho KyongHo [Mon, 5 Mar 2018 07:03:39 +0000 (16:03 +0900)]
g2d: remove redundant cache flush
g2d_flush_command_page() cleans the command list for the secure world
to update the commands in the list correctly. But it is also done in
g2d_hw_push_task().
Change-Id: Ic69c0d8cbb11fecd673411f1aa6d2ed19f3bd493
Signed-off-by: Cho KyongHo <pullip.cho@samsung.com>
Cho KyongHo [Mon, 12 Feb 2018 05:50:34 +0000 (14:50 +0900)]
g2d: fix use of ION API for 4.14 kernel
ION is dramatically changed in 4.14 kernel including kernel API and
the header files. But the symantics of ION API is not changed.
Change-Id: I24ca55a603d5a39ce0da40d18782e40b4a14e43b
Signed-off-by: Cho KyongHo <pullip.cho@samsung.com>
Cho KyongHo [Thu, 18 Jan 2018 08:49:35 +0000 (17:49 +0900)]
g2d: delete timer before initialization
Change-Id: I20e08cb2ec0e4cb9760a3bd29acada138fbcf231
Signed-off-by: Cho KyongHo <pullip.cho@samsung.com>
Cho KyongHo [Fri, 19 Jan 2018 03:20:34 +0000 (12:20 +0900)]
g2d: fix fence timeout handling
If an fence timeout is caused by unsignaled fences, G2D driver
forcefully schedules the task to H/W because it is not a good idea
that a driver waits for a fence to be signaled undefinitely.
Sometimes fence timeout is happened when a task queued in the
workqueue is pended too long. We don't need to restart the fence
timer again because is has no meaning to recover the situation.
Moreover, it may corrupt the timer initialized for H/W timeouts if
the restarting timer for fence happens later than initializing the
timer for H/W.
In the most cases, fence timeout is happened by unsigned fences. The
counter task.starter is not zeroed when the expired task is forcefully
started. It makes confusing when debugging problems related to
timeouts.
Change-Id: I2bdcc9df1b891cdeaf315b3380f41a99cc5a3ce0
Signed-off-by: Cho KyongHo <pullip.cho@samsung.com>
Cho KyongHo [Wed, 17 Jan 2018 04:48:12 +0000 (13:48 +0900)]
g2d: fix BUG() when logging events
The following message caused by smp_processor_id() when it is not
called in atomic context to keep the consistency of the processor
id during the task related to the processor id is completed.
<3>[ 66.158972] [7:composer@2.1-se: 1919] BUG: using smp_processor_id() in preemptible [
00000000] code: composer@2.1-se/1919
<4>[ 66.158989] [7:composer@2.1-se: 1919] caller is debug_smp_processor_id+0x1c/0x24
<4>[ 66.158999] [7:composer@2.1-se: 1919] CPU: 7 PID: 1919 Comm: composer@2.1-se Tainted: G S
4.14.13-g7ad8263aec9d #83
<4>[ 66.159006] [7:composer@2.1-se: 1919] Hardware name: Samsung UNIVERSAL9810 board based on EXYNOS9810 (DT)
<4>[ 66.159012] [7:composer@2.1-se: 1919] Call trace:
<4>[ 66.159024] [7:composer@2.1-se: 1919] [<
ffffff800808b4f4>] dump_backtrace+0x0/0x418
<4>[ 66.159032] [7:composer@2.1-se: 1919] [<
ffffff800808b920>] show_stack+0x14/0x1c
<4>[ 66.159042] [7:composer@2.1-se: 1919] [<
ffffff80087a442c>] dump_stack+0x88/0xac
<4>[ 66.159049] [7:composer@2.1-se: 1919] [<
ffffff800837cca4>] check_preemption_disabled+0xd0/0xf4
<4>[ 66.159055] [7:composer@2.1-se: 1919] [<
ffffff800837cce4>] debug_smp_processor_id+0x1c/0x24
<4>[ 66.159065] [7:composer@2.1-se: 1919] [<
ffffff80084324c0>] g2d_stamp_task+0xa0/0x104
<4>[ 66.159071] [7:composer@2.1-se: 1919] [<
ffffff800842ac90>] g2d_ioctl+0x374/0x424
<4>[ 66.159080] [7:composer@2.1-se: 1919] [<
ffffff8008203a64>] vfs_ioctl+0x20/0x38
<4>[ 66.159086] [7:composer@2.1-se: 1919] [<
ffffff8008204548>] do_vfs_ioctl+0x9c0/0xa6c
<4>[ 66.159093] [7:composer@2.1-se: 1919] [<
ffffff8008204654>] SyS_ioctl+0x60/0x88
Even though g2d driver does not need the consistency because it just
uses it for logging the current CPU, it is required to kill the
unnecessary messages.
Change-Id: Ie6be45bc1457cb8936c388f80bc9b837fb4d2afa
Signed-off-by: Cho KyongHo <pullip.cho@samsung.com>
Cho KyongHo [Tue, 16 Jan 2018 02:03:38 +0000 (11:03 +0900)]
[HACK] g2d: ignore performance request
PMQOS for peripherals is not ready in the kernel.
Change-Id: Ib6b7b3f0a0ce3f8d3ccaa2008db0ac5edea79435
Signed-off-by: Cho KyongHo <pullip.cho@samsung.com>
hyesoo.yu [Thu, 28 Dec 2017 01:45:25 +0000 (10:45 +0900)]
[COMMON] g2d: remove BITBLT_START_REG on commands
The BITBLT_START_REG is not necessary to run the job
manager
Change-Id: I538a9725107123c504612912d29f5a9664cbe291
Signed-off-by: hyesoo.yu <hyesoo.yu@samsung.com>
hyesoo.yu [Tue, 19 Dec 2017 09:50:27 +0000 (18:50 +0900)]
[COMMON] g2d: kill the task when the invalid condition
kill the task and show the debugging information
when every tasks pushed to g2d H/W are queued.
Change-Id: Id0c26c37979936b9b0942364438f9899c17e013a
Signed-off-by: hyesoo.yu <hyesoo.yu@samsung.com>
hyesoo.yu [Wed, 27 Dec 2017 01:42:01 +0000 (10:42 +0900)]
[COMMON] g2d: remove from qos contexts on release
Context should be removed from qos context
to prevent access after being removed on release
although g2d still needs performance
Change-Id: Id4dae0f3dc7d142c95c5e6de50503f3857289830
Signed-off-by: hyesoo.yu <hyesoo.yu@samsung.com>
Cho KyongHo [Thu, 23 Nov 2017 08:05:04 +0000 (17:05 +0900)]
[COMMON] gpu: g2d: fix implicit type conversion
Prevent CID: 202021
Prevent CID: 202003
Prevent CID: 202000
Prevent CID: 201961
Prevent CID: 201909
Prevent CID: 201887
Prevent CID: 201224
Change-Id: I93b6f65617f0e25e11e63eff0fe46da42f3a0117
Signed-off-by: Cho KyongHo <pullip.cho@samsung.com>
hyesoo.yu [Fri, 17 Nov 2017 08:31:33 +0000 (17:31 +0900)]
[COMMON] g2d: increase g2d INT lock for performance
Change-Id: I80c007b17986f38dff865ca47b8d176bb89d5742
Signed-off-by: hyesoo.yu <hyesoo.yu@samsung.com>
hyesoo.yu [Tue, 14 Nov 2017 10:00:55 +0000 (19:00 +0900)]
Revert "[COMMON] g2d: disable sharabiltiy feature on g2d"
This reverts commit
591b3c1c10af821c54eab5b72121e99ffa6c4772.
Change-Id: I59dc83d3660c35b06b4221725cf223574534a66f
Signed-off-by: hyesoo.yu <hyesoo.yu@samsung.com>
hyesoo.yu [Mon, 13 Nov 2017 06:15:19 +0000 (15:15 +0900)]
[COMMON] g2d: fix the error for cache flush of target
Change-Id: I6b5d081fcf781797872e7072e52965fadf2585d5
Signed-off-by: hyesoo.yu <hyesoo.yu@samsung.com>
Cho KyongHo [Mon, 13 Nov 2017 02:28:30 +0000 (11:28 +0900)]
[COMMON] g2d: disable sharabiltiy feature on g2d
Change-Id: I294f5974c57618cdae9aff5354f188db5334bfc5
Signed-off-by: Cho KyongHo <pullip.cho@samsung.com>
hyesoo.yu [Mon, 25 Sep 2017 10:11:35 +0000 (19:11 +0900)]
[COMMON] g2d: clear sharability attribute
If the device doesn't support the sharablity, S bit
should be cleared on system page table.
Change-Id: I49d5e843d81e43ce5a176720823afbdf36de6681
Signed-off-by: hyesoo.yu <hyesoo.yu@samsung.com>
hyesoo.yu [Thu, 9 Nov 2017 06:43:05 +0000 (15:43 +0900)]
[COMMON] g2d: fix out-of-bound of fence name
Fix global-out-of-bounds to copy the fence name
Change-Id: I388a2f007868e98612f62f23bc8bc0a632a8883c
Signed-off-by: hyesoo.yu <hyesoo.yu@samsung.com>
hyesoo.yu [Thu, 2 Nov 2017 12:47:44 +0000 (21:47 +0900)]
[COMMON] g2d: eliminate unnecessary cache maintenance
The g2d execute cache maintencance only for the cachable
buffer that is accessed by GPU if device is coherent,
so condition check for cache maintenance is fixed.
Change-Id: I9b8fa16cddcd12c00ed95fc08e4d4e179411938e
Signed-off-by: hyesoo.yu <hyesoo.yu@samsung.com>
hyesoo.yu [Wed, 1 Nov 2017 05:27:21 +0000 (14:27 +0900)]
[COMMON] g2d: split the dump function
In an abnormal state, there may not be any task to run
even in mmu fault and error interrupt state, and
this case might be accessed to NULL pointer on stamp
function, so split the debugging message function
from stamp function and print more information.
Change-Id: Iadb1838c166cdfa3f4221a4ed30888734ba6303f
Signed-off-by: hyesoo.yu <hyesoo.yu@samsung.com>
Cho KyongHo [Mon, 16 Oct 2017 06:58:53 +0000 (15:58 +0900)]
[COMMON] g2d: add support for custom tone mapping LUT
The look-up table for tone mapping can be overwritten by the superuser
through the module parameter of hdr_tunables module intorduced by
"video: hdr: add tunable parameters for HDR" commit.
Once tone mapping LUT has been written to the parameter and becomes
valid, it is immediately applied to every tasks executed by G2D. All
tone mapping coefficients are overwritten with the values in the
paramter.
Change-Id: I871bfe6d9ab4740ad8519b09f0a5b1bce257d1c3
Signed-off-by: Cho KyongHo <pullip.cho@samsung.com>
Cho KyongHo [Thu, 12 Oct 2017 08:03:25 +0000 (17:03 +0900)]
[COMMON] video: hdr: add tunable parameters for HDR
It is required to tune HDR LUT values during runtime because the
quality of HDR processing is measured on the display of DUT. It means
that some LUT values including LUTs of tone mapping might need to be
tunned if the display controller or LCD is changed.
Change-Id: Ic927345a25f6b2d45d7be9de47f2a0574514ff64
Signed-off-by: Cho KyongHo <pullip.cho@samsung.com>
hyesoo.yu [Thu, 19 Oct 2017 12:29:47 +0000 (21:29 +0900)]
[COMMON] g2d: add afbc debugging information
Show the internal state on AFBC decoder core when timeout
or error interrupt, mmu fault happens.
Change-Id: Ia2ae7cdc4137c7e2ef8ba3eb4dc86c7128915e9c
Signed-off-by: hyesoo.yu <hyesoo.yu@samsung.com>
hyesoo.yu [Mon, 16 Oct 2017 11:39:19 +0000 (20:39 +0900)]
[COMMON] g2d: cancel callback of acquire fence
If the user request has error parameter, the acquire
fence was put but the callback of fence is remained.
The new request on the same task structure registers
the callback to another fence, the list was corrupted.
It makes panic or hard lockup on system, so fix it.
Change-Id: I19ccbc06668c0d418fee675bf53188c6c37db3f9
Signed-off-by: hyesoo.yu <hyesoo.yu@samsung.com>
hyesoo.yu [Tue, 10 Oct 2017 06:40:02 +0000 (15:40 +0900)]
[COMMON] g2d: add limitations of H/W flow control
When G2D performs a H/W Flow Control job, following
limitations are observed,
1. Does not support AFBC format is not supported
as the destination format
2. Z-Order of tile order is not supported
Change-Id: I0f5f0f08602a9000ee417e2ea349434a3af8a4a4
Signed-off-by: hyesoo.yu <hyesoo.yu@samsung.com>
Cho KyongHo [Wed, 27 Sep 2017 11:16:32 +0000 (20:16 +0900)]
[COMMON] g2d: add support for BGR565
Change-Id: Iafdcfb030c01d770796548ef4d8c0a7488ebce93
Signed-off-by: Cho KyongHo <pullip.cho@samsung.com>
hyesoo.yu [Mon, 25 Sep 2017 00:12:30 +0000 (09:12 +0900)]
[COMMON] g2d: add extra information for debug
First, we add the time from user request to H/W start,
and from H/W start to H/W finishing.
Second, we record H/W status on error interrupt or H/W
timeout without exception.
Third, we record whether the task has compressed format
or not when acquire fence timeout happens due to possibility
to read without writing all.
Change-Id: Idd0b274f23f6221af1e652482f23957d7931bf4e
Signed-off-by: hyesoo.yu <hyesoo.yu@samsung.com>
hyesoo.yu [Mon, 25 Sep 2017 01:35:59 +0000 (10:35 +0900)]
[COMMON] g2d: fix to read the job state
The register of JOB_IDn_STATE should be masked
to read the job state.
Change-Id: I964c2a22073d64a3c9150fa06e2060192c5d149d
Signed-off-by: hyesoo.yu <hyesoo.yu@samsung.com>
hyesoo.yu [Fri, 15 Sep 2017 08:34:08 +0000 (17:34 +0900)]
[COMMON] g2d: fix unintended sign extension
Multiplying crop_w and crop_h could be promoted in
type signed 32bit, then signed extended to type
unsigned long long, so fix signed extension.
Change-Id: Id10e2c04fef0ab1a682bc5b65c7d86e2da256725
Signed-off-by: hyesoo.yu <hyesoo.yu@samsung.com>
hyesoo.yu [Fri, 8 Sep 2017 05:33:48 +0000 (14:33 +0900)]
[COMMON] g2d: fix to access the NULL pointer
Fix referencing a pointer that might be null &mm->mmap_sem
when calling down_read
Change-Id: I5e960fac24e6218f0ef71fe33d8e72bfa119d268
Signed-off-by: hyesoo.yu <hyesoo.yu@samsung.com>
hyesoo.yu [Fri, 8 Sep 2017 05:29:16 +0000 (14:29 +0900)]
[COMMON] g2d: fix out-of-bounds read
Overrunning array release_fences of 17 4-byte elements at
element index
4294967294 (byte offset
17179869176) using index
Change-Id: I18d984096c8975fb2afc38a2785baf8e5505ca4d
Signed-off-by: hyesoo.yu <hyesoo.yu@samsung.com>
hyesoo.yu [Mon, 28 Aug 2017 04:32:45 +0000 (13:32 +0900)]
[COMMON] g2d: set CAPTURE_IDX for every tasks
Even if it is a normal task, command list must
explicitly be stated in CAPTURE_IDX that it is not
a hwfc task.
Change-Id: Ic2d766d4bd5bf15b2e684e90e91d602f9c65176b
Signed-off-by: hyesoo.yu <hyesoo.yu@samsung.com>
hyesoo.yu [Fri, 18 Aug 2017 02:21:56 +0000 (11:21 +0900)]
[COMMON] g2d: release performance lock
If there is no further request from the user for 50ms,
performance lock is released automatically.
Change-Id: Id36220bbe6eecd45c716fd1c83f3e12f523c3f82
Signed-off-by: hyesoo.yu <hyesoo.yu@samsung.com>
hyesoo.yu [Fri, 18 Aug 2017 00:59:12 +0000 (09:59 +0900)]
[COMMON] g2d: move setting hwfc data
HWFC buffer information sholud be set from
repeater driver before payload calculation.
Change-Id: I1497b1673ead7fc4edcae6df1e0ce5ff095b2bdb
Signed-off-by: hyesoo.yu <hyesoo.yu@samsung.com>
hyesoo.yu [Wed, 16 Aug 2017 02:08:13 +0000 (11:08 +0900)]
[COMMON] g2d: fix unsigned datatype
'get_unused_fd_flags' is stored in unsigned datatype,
so could not be handled on error.
Change-Id: I9447fd5fd7ccb9d6cdb782607197ad24360058fc
Signed-off-by: hyesoo.yu <hyesoo.yu@samsung.com>
hyesoo.yu [Wed, 9 Aug 2017 09:37:08 +0000 (18:37 +0900)]
[COMMON] g2d: fix formula based on measured value
H/W performance varies depending on scaling ratio,
size, rotation and format. Based on the measured
times, PPC is calculated again.
Change-Id: I8993e20aee1c94f5a07290fe754e612c66adc8da
Signed-off-by: hyesoo.yu <hyesoo.yu@samsung.com>
hyesoo.yu [Thu, 10 Aug 2017 05:18:34 +0000 (14:18 +0900)]
[COMMON] g2d: show HDR coefficients
Add the debug information for HDR coefficients
Change-Id: I2c59c9030197061265f85a6d5aef59184343211a
Signed-off-by: hyesoo.yu <hyesoo.yu@samsung.com>
hyesoo.yu [Fri, 14 Jul 2017 04:23:08 +0000 (13:23 +0900)]
[COMMON] g2d: fix the security hole
Secure layer information could be changed at any time
on normal OS. That is, someone can change the destination
from secure to normal by hacking maliciously.
To solve this problem, modify that every task has
been pushed in the secure world.
Change-Id: Ic6a35920452f49bd735a4e3545a22d71cba7c190
Signed-off-by: hyesoo.yu <hyesoo.yu@samsung.com>
hyesoo.yu [Thu, 24 Aug 2017 01:23:06 +0000 (10:23 +0900)]
Revert "[COMMON] g2d: fix the security hole"
This reverts commit
1bf32e2b0e09c41067a2ed93bc14655649393095.
Change-Id: Ic189da048a05e819a82430556603953f77bdc8f7
Signed-off-by: hyesoo.yu <hyesoo.yu@samsung.com>
hyesoo.yu [Thu, 24 Aug 2017 01:22:35 +0000 (10:22 +0900)]
Revert "[COMMON] g2d: show HDR coefficients"
This reverts commit
f28d97ad694fdf55d37c514cc0946af17ea2070f.
Change-Id: I07a7024b2922d3551dc7ea7e1a648750af189e0b
Signed-off-by: hyesoo.yu <hyesoo.yu@samsung.com>
hyesoo.yu [Thu, 24 Aug 2017 01:22:22 +0000 (10:22 +0900)]
Revert "[COMMON] g2d: fix formula based on measured value"
This reverts commit
8b6985f10269521f49d54bcf17ee731cca671dd3.
Change-Id: I56b70b99e2e94378c9014dc3aad623fb769f46ad
Signed-off-by: hyesoo.yu <hyesoo.yu@samsung.com>
hyesoo.yu [Thu, 24 Aug 2017 01:20:20 +0000 (10:20 +0900)]
Revert "[COMMON] g2d: fix unsigned datatype"
This reverts commit
15ffb6b6f57e0e8152d3e0b647ae3454fbc8cb40.
Change-Id: Ibdbdefc7e542290d335d2ea98a6881b5151c7880
Signed-off-by: hyesoo.yu <hyesoo.yu@samsung.com>
hyesoo.yu [Thu, 24 Aug 2017 01:19:56 +0000 (10:19 +0900)]
Revert "[COMMON] g2d: move setting hwfc data"
This reverts commit
713b7ef688f8b3e3276f073bf8c3c620d30f31e9.
Change-Id: If0f3894a02f7fdec90b229040658d7c2d8096b58
Signed-off-by: hyesoo.yu <hyesoo.yu@samsung.com>
hyesoo.yu [Thu, 24 Aug 2017 01:22:07 +0000 (10:22 +0900)]
Revert "[COMMON] g2d: release performance lock"
This reverts commit
e17b747d223fd86c18f6e110658489f6aba706d8.
Change-Id: I254fe53b13a63981cd9fc9d72f2d8c412576d52e
Signed-off-by: hyesoo.yu <hyesoo.yu@samsung.com>
hyesoo.yu [Fri, 18 Aug 2017 02:21:56 +0000 (11:21 +0900)]
[COMMON] g2d: release performance lock
If there is no further request from the user for 50ms,
performance lock is released automatically.
Change-Id: If1548cf253d74fbf2ea5034077989d8072cbfd23
Signed-off-by: hyesoo.yu <hyesoo.yu@samsung.com>
hyesoo.yu [Fri, 18 Aug 2017 00:59:12 +0000 (09:59 +0900)]
[COMMON] g2d: move setting hwfc data
HWFC buffer information sholud be set from
repeater driver before payload calculation.
Change-Id: Ia8717c99a991a0db5441a745b58d884a3a51328b
Signed-off-by: hyesoo.yu <hyesoo.yu@samsung.com>
hyesoo.yu [Wed, 16 Aug 2017 02:08:13 +0000 (11:08 +0900)]
[COMMON] g2d: fix unsigned datatype
'get_unused_fd_flags' is stored in unsigned datatype,
so could not be handled on error.
Change-Id: I009949ab228689bc0aed21615894ecdb9de926ea
Signed-off-by: hyesoo.yu <hyesoo.yu@samsung.com>
hyesoo.yu [Wed, 9 Aug 2017 09:37:08 +0000 (18:37 +0900)]
[COMMON] g2d: fix formula based on measured value
H/W performance varies depending on scaling ratio,
size, rotation and format. Based on the measured
times, PPC is calculated again.
Change-Id: I6fcfef745ec83eda26647a5d4bad9c994cff4a3f
Signed-off-by: hyesoo.yu <hyesoo.yu@samsung.com>
hyesoo.yu [Thu, 10 Aug 2017 05:18:34 +0000 (14:18 +0900)]
[COMMON] g2d: show HDR coefficients
Add the debug information for HDR coefficients
Change-Id: Ic2af15a1b127d908ab04534bf99581fb3602a46a
Signed-off-by: hyesoo.yu <hyesoo.yu@samsung.com>
hyesoo.yu [Fri, 14 Jul 2017 04:23:08 +0000 (13:23 +0900)]
[COMMON] g2d: fix the security hole
Secure layer information could be changed at any time
on normal OS. That is, someone can change the destination
from secure to normal by hacking maliciously.
To solve this problem, modify that every task has
been pushed in the secure world.
Change-Id: I1e1a272f8fea8d8fa78c060696b3fa457165c4a2
Signed-off-by: hyesoo.yu <hyesoo.yu@samsung.com>
Cho KyongHo [Wed, 16 Aug 2017 08:36:34 +0000 (17:36 +0900)]
[COMMON] g2d: add support for inverse dither of sources
Change-Id: Idd859b6c5595e41136183029891da3aff34f3a7c
Signed-off-by: Cho KyongHo <pullip.cho@samsung.com>
hyesoo.yu [Fri, 28 Jul 2017 00:57:26 +0000 (09:57 +0900)]
[COMMON] g2d: remove to overwrite priority.
The priority of context always set the priority of
task, however the priority of user's task data
overwrite the task priority.
Change-Id: Ib172b5021ed0841588c738e5c0dd5aa626abb6f7
Signed-off-by: hyesoo.yu <hyesoo.yu@samsung.com>
hyesoo.yu [Tue, 25 Jul 2017 06:56:14 +0000 (15:56 +0900)]
[COMMON] g2d: calculate the laptime.
The time is calculated after completing the task
Change-Id: I1c1fced152fcb3198eab5cb93a1b4d1638e6137c
Signed-off-by: hyesoo.yu <hyesoo.yu@samsung.com>
hyesoo.yu [Thu, 20 Jul 2017 00:51:13 +0000 (09:51 +0900)]
[COMMON] g2d: change mode to secure before running
The existing has problem because the secure mode is not
enabled again when suspend resume happens.
Therefore the secure mode is changed immediately before
running to resolve the problem.
Change-Id: I4fe22d81fc241d99276d4eac5fc8b8db32777fb7
Signed-off-by: hyesoo.yu <hyesoo.yu@samsung.com>
hyesoo.yu [Wed, 19 Jul 2017 13:40:11 +0000 (22:40 +0900)]
[COMMON] g2d: unlock the spinlock on error handling
The workqueue must be terminated after the spinlock
has been released. However, that is missing when
handing of suspend, so fix it.
BUG: workqueue leaked lock or atomic: kworker/u16:8/0x00000001/5856
Change-Id: I6f9a36095dd9673dd57e38f24a3d306e1407529a
Signed-off-by: hyesoo.yu <hyesoo.yu@samsung.com>
hyesoo.yu [Fri, 7 Jul 2017 02:35:16 +0000 (11:35 +0900)]
[COMMON] g2d: add fimg2d node
The user that opens "fimg2d" has permission 0x666,
so this user doesn't have authority to request priority
or performance, because the user that has high authority
should not be disturbed by lower authority user.
Change-Id: Ie9af31be60d7d2d80df3fdae561547d8db82440c
Signed-off-by: hyesoo.yu <hyesoo.yu@samsung.com>