Cho KyongHo [Wed, 22 Jul 2015 14:42:02 +0000 (23:42 +0900)]
[COMMON] media: smfc: use s/w timer if HWFC is enabled
If HWFC is enabled, the internal timer in the H/W is not available
because when the H/W finishes depends on the outside of SMFC itself.
Instead of the internal timer, S/W timer is used for the case of HWFC.
S/W timer is expired if the H/W is not completed in a second that is
quite huge amount of time.
Change-Id: I0a23448033b91bcb64523cebfeeee14d78c0f410
Signed-off-by: Cho KyongHo <pullip.cho@samsung.com>
Cho KyongHo [Wed, 22 Jul 2015 08:04:12 +0000 (17:04 +0900)]
[COMMON] media: smfc: clean the dirty region by CPU in .buf_cleaup
Even though userspace gives V4L2_BUF_FLAG_NO_CACHE_CLEAN flag in
the v4l2_buffer on qbuf, it just guarantees that the buffer after
the specific offset is not cache dirty by CPU.
If the offset become smaller than the previous, H/W may starts to
write the compressed stream on the area that may have dirty cache
lines.
To prevent the problem, the driver should clean the dirty cache lines
if the offset becomes no longer valied.
Change-Id: I54baba493dd4c179eda740bedba3378d4abe8435
Signed-off-by: Cho KyongHo <pullip.cho@samsung.com>
Cho KyongHo [Wed, 15 Jul 2015 05:08:01 +0000 (14:08 +0900)]
[COMMON] media: smfc: disable timeout interrupt during HWFC is on
If HWFC is enabled, MC Scaler that generates the source image of SMFC
may starts significantly later than SMFC. We have observed that SMFC
asserts timeout if MC Scalert starts working in the mean time. To
prevent unexpected timeout interrupt, it is reqruied to disable the
timeout interrupt.
Instead of timeout interrupt, hurry threashold interrupt should be
used to detect a problem during compression.
Change-Id: I92d3bf5bfcceb7f757a8600d3623da4127e1519c
Signed-off-by: Cho KyongHo <pullip.cho@samsung.com>
Cho KyongHo [Wed, 15 Jul 2015 05:02:38 +0000 (14:02 +0900)]
[COMMON] media: smfc: fix missing secondary interrupt status
SMFC can asserts without no status indication bit of the main image set
if the secondary image causes the interrupt.
Therefor the driver should check the interrupt status of the secondary
image when the interrupt is occurred even though 0 is read from the
interrupt status register of the main image.
Change-Id: I9581213730c88a0f51f414aa29c84f08ed3783c2
Signed-off-by: Cho KyongHo <pullip.cho@samsung.com>
Cho KyongHo [Wed, 15 Jul 2015 05:04:55 +0000 (14:04 +0900)]
[COMMON] media: smfc: fix incorrect image format check for HWFC
HWFC requires the source image is YUV422 1 plane or YUV420 2 plane.
Change-Id: I5dfeb95cd66a2e9ce5d7cb353a2b249fc469a825
Signed-off-by: Cho KyongHo <pullip.cho@samsung.com>
Cho KyongHo [Wed, 15 Jul 2015 04:46:48 +0000 (13:46 +0900)]
[COMMON] media: smfc: do not chroma subsampling for thumbnail with HWFC
If Hardware Flow Control is enabled, we have observed that the SMFC
asserts the invalid thumbnail encoding configuration interrupt if the
chroma subsampling factor of the thumbnail JPEG stream is different
from the one of the main JPEG stream.
Change-Id: Ia003859ab08c89f2df3867da36789be476a84b26
Signed-off-by: Cho KyongHo <pullip.cho@samsung.com>
Cho KyongHo [Wed, 1 Jul 2015 06:57:59 +0000 (15:57 +0900)]
[COMMON] media: smfc: fix missing buffer length for RGB32 formats
Change-Id: Ic2b20937eaa19b79f1264c86c9a46bb662e99714
Signed-off-by: Cho KyongHo <pullip.cho@samsung.com>
Cho KyongHo [Wed, 1 Jul 2015 06:22:23 +0000 (15:22 +0900)]
[COMMON] media: smfc: fix unexpected warning during .stop_streaming
Videobuf2 asserts warning when vb2_buffer_done() is called for non
active buffers. .stop_streaming() in the driver also has a problem
because it should cancel the queued buffers rather than canceling
all buffers.
Change-Id: I9041c34f6810d8e8aeeffd6b890db226dc2ef640
Signed-off-by: Cho KyongHo <pullip.cho@samsung.com>
Cho KyongHo [Wed, 1 Jul 2015 02:58:35 +0000 (11:58 +0900)]
[COMMON] media: smfc: replace v4l2 and vb2 ops with default ones
videobuf2 provides the default logic that is to be done in
.wait_prepare() and .wait_finish().
v4l2_mem2mem provides the default logic of stream API.
Change-Id: I15916a9834a164073dded387e2cd38f1fa8d22bf
Signed-off-by: Cho KyongHo <pullip.cho@samsung.com>
Cho KyongHo [Tue, 2 Jun 2015 07:27:54 +0000 (16:27 +0900)]
[COMMON] media: smfc: measure H/W delay
The delay in usec. is stored to reserved2 field of v4l2_buffer of
capture queue.
Change-Id: I91165095d69003d67c48a36a147d03a386d9ed89
Signed-off-by: Cho KyongHo <pullip.cho@samsung.com>
Cho KyongHo [Mon, 18 May 2015 15:01:02 +0000 (00:01 +0900)]
[COMMON] media: smfc: initialize all formats with chroma subsampling factor 1
Otherwise, size check will fail due to zero factor.
Change-Id: I56baa4a36b1fc9f5b7e22f8237aa506358a68bb2
Signed-off-by: Cho KyongHo <pullip.cho@samsung.com>
Cho KyongHo [Mon, 18 May 2015 10:32:57 +0000 (19:32 +0900)]
[COMMON] media: smfc: dump SFR when unexpected IRQ invoked
Dumping SFR helps to debug unexpected IRQ.
Change-Id: I58aa822c127b8087beee5c521445a8f67e18db76
Signed-off-by: Cho KyongHo <pullip.cho@samsung.com>
Cho KyongHo [Mon, 18 May 2015 10:30:29 +0000 (19:30 +0900)]
[COMMON] media: smfc: clear JPEG codec state after IRQ
It is guided that MAIN_JPEG_CNTL[1:0] should be cleared after IRQ is
handled.
Change-Id: I83e11b9e7844fc27a4d8e538350ee4ca859e9055
Signed-off-by: Cho KyongHo <pullip.cho@samsung.com>
Cho KyongHo [Mon, 18 May 2015 07:37:49 +0000 (16:37 +0900)]
[COMMON] media: smfc: fix inconsistency in hardware state
Setting SMFC_DEV_RUNNING is after configuring H/W to start working.
If IRQ is occurred before configuring the flag, the IRQ handler
is called before the flag set.
Change-Id: I3f408f569b7265eb368b9efc38cffdb13d79fff2
Signed-off-by: Cho KyongHo <pullip.cho@samsung.com>
Cho KyongHo [Wed, 13 May 2015 05:35:31 +0000 (14:35 +0900)]
[COMMON] media: smfc: fix typo in comment
Fix errortum in comment 'aaray' to 'array'.
Change-Id: If3bc715bfd3b6772b19a920690de61691d2e3967
Signed-off-by: Cho KyongHo <pullip.cho@samsung.com>
Cho KyongHo [Wed, 13 May 2015 01:14:43 +0000 (10:14 +0900)]
[COMMON] media: smfc: fix configuration to MAX_STREAM_SIZE register
If SMFC finds that the compressed stream should be written over the
size configured in MAX_STREAM_SIZE register, it stops working and
asserts interrupt to the CPU that the destination buffer is too small
to store the compressed stream.
The restriction of the value in MAX_STREAM_SIZE:
- The value should be multiple of 64
- If the stream base is not aligned by 16 bytes, 64 - unaligned bytes
should be added to the value.
Change-Id: I2198d001d93a8b6ad03a0c02f928bd1d65b85983
Signed-off-by: Cho KyongHo <pullip.cho@samsung.com>
Cho KyongHo [Fri, 15 May 2015 10:57:08 +0000 (19:57 +0900)]
[COMMON] media: smfc: fix doubling number of planes
Doubling the number of planes in s_fmt() handler considers that the
number of buffers should be doubled the number of planes when back-
to-back compression is enabled. But it is implicitly configued during
qbuf(). Userspace qbufs double number of buffers than the number of
planes.
Change-Id: I70312ef199214cc3794c32ff2e8a719f5f11ffaf
Signed-off-by: Cho KyongHo <pullip.cho@samsung.com>
Cho KyongHo [Fri, 15 May 2015 07:42:08 +0000 (16:42 +0900)]
[COMMON] media: smfc: remove empty function
smfc_configure_secondary_image() contains nothing.
Change-Id: I3c79c7ea588b75e69e2d895e54c129959c8f2c52
Signed-off-by: Cho KyongHo <pullip.cho@samsung.com>
Cho KyongHo [Thu, 14 May 2015 13:19:29 +0000 (22:19 +0900)]
[COMMON] media: smfc: fix reversed order in printing index and value
.buf_prepare() shows "Too small bytes_used[
11985408]=0..." if
bytes_used in v4l2_buffer is smaller than the required buffer size
according to the image format configured with s_fmt. But the value in
the bracket should be the plane index and the value after equal sign
should be the value stored in .bytes_used.
Change-Id: I4697c5e8474db2b4291ac0a41dd928899c0cc183
Signed-off-by: Cho KyongHo <pullip.cho@samsung.com>
Cho KyongHo [Mon, 4 May 2015 06:13:32 +0000 (15:13 +0900)]
[COMMON] media: smfc: add support for HWFC configuration
HWFC is configurable with V4L2_CID_JPEG_HWFC_ENABLE boolean control.
It is only configurable with YUV422 1-plane and YUV420 2-plane
without change in chroma subsampling ratio. Otherwise, users will
get error.
Change-Id: I09d0ac8b0cd6aa801ad611f3b8a065b84c00c4bf
Signed-off-by: Cho KyongHo <pullip.cho@samsung.com>
Cho KyongHo [Mon, 4 May 2015 07:06:30 +0000 (16:06 +0900)]
[COMMON] media: smfc: return error if error found in .device_run()
There may be an error during pm_runtime_get() or clk_enable(). In that
situation, the driver should handle the exceptional cases.
Change-Id: If2ad5fc261eeb3e957a9abfeecac26fe66478d80
Signed-off-by: Cho KyongHo <pullip.cho@samsung.com>
Cho KyongHo [Mon, 4 May 2015 06:47:38 +0000 (15:47 +0900)]
[COMMON] media: smfc: store control variables at the start of H/W run
V4L2 control variables can be configured during H/W configuration.
Direct reference to the control variables several during H/W
configuration may result in inconsistent configuration to the H/W
because users may change the control variables during H/W
configurations. Therefore it is safe to keep a copy of the values
of the control variables before H/W configuration and to refer to
the copy. It is not important to configure the most latest values
of the control variables because the users do not know when the
H/W is configured.
Change-Id: I22a1b0d8a9ffa2e77b311559028fc2560a4eb122
Signed-off-by: Cho KyongHo <pullip.cho@samsung.com>
Cho KyongHo [Thu, 23 Apr 2015 05:19:22 +0000 (14:19 +0900)]
[COMMON] media: smfc: wait until the current job finishes before suspending
The driver should ensure that the H/W controlled by the driver is in
idle state so that it is safe to enter the low power mode. SMFC driver
waits until the current job is finished and resuming completion of the
current job after resuming from the low power mode.
Change-Id: I4020a596342a4091fa1c64cdada033ca83c0b76e
Signed-off-by: Cho KyongHo <pullip.cho@samsung.com>
Cho KyongHo [Tue, 21 Apr 2015 05:17:28 +0000 (14:17 +0900)]
[COMMON] media: smfc: cancel queued buffers in .stop_streaming()
stop_streaming() waits for all queued buffers to be finished. But SMFC
driver as a mem2mem device, may wait for the queued buffer of the
current vb2_queue while no buffer is queued in the other vb2_queue.
If .stop_streaming() is called in that situation, it waits for a
buffer to be queued to the other vb2_queue infinitely.
However it will never happen because no user will queue a buffer
during stopping operations on the device. Therefore, the driver
should see if other vb2_queue has a queued buffer when this vb2_queue
is stopping streaming. If the other vb2_queue has no queued buffer,
stop_streaming() should cancel all queued buffers in the current
vb2_queue.
Change-Id: I3b07916707a0b0d238a3238621fea631df8b942d
Signed-off-by: Cho KyongHo <pullip.cho@samsung.com>
Cho KyongHo [Fri, 10 Apr 2015 10:12:51 +0000 (19:12 +0900)]
[COMMON] media: smfc: add System MMU fault handler
Change-Id: Idb1a7cebb4dccb043dc834ceb4daacb5cdd7e983
Signed-off-by: Cho KyongHo <pullip.cho@samsung.com>
Cho KyongHo [Thu, 2 Apr 2015 07:07:11 +0000 (16:07 +0900)]
[COMMON] media: smfc: support for secondary image compression
SMFC supports for back-to-back image compression. It compresses two
images at the same time. Even though SMFC, itself has a single JPEG
compression engine, the users including the driver of SMFC feels that
the two source images are compressed concurrently because it provides
two sets of source image configuration registers and the users receive
two compressed data when the 'frame done' interrupt is asserted.
V4L2 does not consider about the special function like back-to-back
(B2B) compression which requires a couple of source images and results
different output streams for the source images. Thus SMFC driver
requires userspaces to provide the secondary image to compress in a
special way.
- For B2B, the output and capture buffer type should be multi-plane.
- All the format and buffer information passed to the driver from the
the userspace should be the information of the primary image.
- To B2B compression, the userspace should configure
* The width and the height of the secondary image should be
configured in the higher 16-bits of the fields of width and
height of 'struct v4l2_format'
* The color format of the secondary image should be the same as
the primary image. Therefore there is no way to configure
the color format of the secondary image.
* The quality factor of the secondary image should be configured
with the V4L2 control ID 'V4L2_CID_JPEG_CLASS_BASE + 20'.
The parameter is the same as V4L2_CID_JPEG_COMPRESSION_QUALITY.
* The buffer information of the secondary image should be
specified from v4l2_buffer.m.plane[num_planes of the 1st image].
v4l2_buffer.length should be also doubled because the effective
planes are doubled. Otherwise, the users get failure.
Change-Id: I0f0abfe2ca2cc74219646fa4157dc41d5ef1e5b7
Signed-off-by: Cho KyongHo <pullip.cho@samsung.com>
Cho KyongHo [Thu, 2 Apr 2015 07:27:36 +0000 (16:27 +0900)]
[COMMON] media: smfc: dump all control registers on an error interrupt
The current dump is based on Exynos7420 that is the most recent
version of H/W JPEG of the same series.
Change-Id: Ib674d6ce75addb60d94970c4abd3d019a66133f5
Signed-off-by: Cho KyongHo <pullip.cho@samsung.com>
Cho KyongHo [Thu, 2 Apr 2015 01:39:17 +0000 (10:39 +0900)]
[COMMON] media: smfc: add V4L2 control values
SMFC Driver support JPEG class controls which includes quality factor,
chroma subsampling and restart interval.
Change-Id: I34fcd547a38696cd0f3576d6033a19a5f4fd754b
Signed-off-by: Cho KyongHo <pullip.cho@samsung.com>
Cho KyongHo [Wed, 1 Apr 2015 10:24:12 +0000 (19:24 +0900)]
[COMMON] media: smfc: handle exceptional situations
The driver should be robust under very exceptional situations caused
by unexpected behaviors of processes. Some processes may be suddenly
killed without waiting for the completion of request task in the
driver or H/W. Another processes that is not well-designed so that
they can close the opened device node while forgeting to wait for
the completion of their requested tasks.
Even though processes works unexpectedly, SMFC driver now handles
all exceptional cases with waiting for the H/W's working before
releasing all resources referred by the driver. Other resources that
the driver does not care about is handled by the frameworks such as
videobuf2 and v4l2-mem2mem.
Change-Id: I5ec4c3d91a9328e163658b3732a5ab37de30e73c
Signed-off-by: Cho KyongHo <pullip.cho@samsung.com>
Cho KyongHo [Mon, 30 Mar 2015 10:51:59 +0000 (19:51 +0900)]
[COMMON] media: smfc: add basic function of compression by H/W
Now it is able to compress an image with H/W.
Change-Id: I420e4908b1e3c36818ae4be0b548d8c51ddb3fcc
Signed-off-by: Cho KyongHo <pullip.cho@samsung.com>
Cho KyongHo [Mon, 30 Mar 2015 02:19:29 +0000 (11:19 +0900)]
[COMMON] media: smfc: add qbuf/dqbuf V4L2 functions
Change-Id: I897f41912b636287b6d00b96c7edc801e21d24fd
Signed-off-by: Cho KyongHo <pullip.cho@samsung.com>
Cho KyongHo [Sun, 29 Mar 2015 13:02:02 +0000 (22:02 +0900)]
[COMMON] media: smfc: add reqbufs and querybuf V4L2 functions
Change-Id: I980e3ac016be5fd00a7f6aca78959db8943c696a
Signed-off-by: Cho KyongHo <pullip.cho@samsung.com>
Cho KyongHo [Fri, 27 Mar 2015 01:08:45 +0000 (10:08 +0900)]
[COMMON] media: smfc: add g/try/s_fmt V4L2 functions
Change-Id: If8768fa8ef4f5ffa4318260545c2bfcea35fc296
Signed-off-by: Cho KyongHo <pullip.cho@samsung.com>
Cho KyongHo [Fri, 27 Mar 2015 01:09:21 +0000 (10:09 +0900)]
[COMMON] media: smfc: add querycap V4L2 function
Change-Id: I3e16ac1bc6a630c9e5c0b6c831b57ae865760aa7
Signed-off-by: Cho KyongHo <pullip.cho@samsung.com>
Cho KyongHo [Thu, 26 Mar 2015 06:04:40 +0000 (15:04 +0900)]
[COMMON] media: smfc: add format definitions and enumeration
Change-Id: Idf188d3d4a40195abea841e535ef7352bd593d02
Signed-off-by: Cho KyongHo <pullip.cho@samsung.com>
Cho KyongHo [Wed, 25 Mar 2015 00:03:25 +0000 (09:03 +0900)]
[COMMON] media: smfc: add skelton implementation of v4l2.
The SMFC driver with V4L2 support is prepared. This patch includes
- registration to video_device
- buffer management with videobuf2-dma-sg
- job scheduling by v4l2-mem2mem
- V4L2 control handling by v4l2_fh
It is not the complete implementation. The following patches complete
the driver.
Change-Id: I19c3c5668c6ff975a7b55a0b9efc6147f94f143c
Signed-off-by: Cho KyongHo <pullip.cho@samsung.com>
Cho KyongHo [Tue, 24 Mar 2015 07:55:35 +0000 (16:55 +0900)]
[COMMON] media: smfc: introduce new SMFC driver
Just probing is available.
Change-Id: I4f2c739cb847924253be4cfbe8f43b0d1f36d481
Signed-off-by: Cho KyongHo <pullip.cho@samsung.com>
Janghyuck Kim [Mon, 21 May 2018 11:10:30 +0000 (20:10 +0900)]
[9610] arm64: defconfig: enable scaler
Change-Id: Ic6c7764c58c9d50fc72bdcd806b605154b8c50ba
Signed-off-by: Janghyuck Kim <janghyuck.kim@samsung.com>
hyesoo.yu [Wed, 23 May 2018 07:45:37 +0000 (16:45 +0900)]
[9610] arm64: defconfig: enable g2d
Change-Id: Ib96dafef5cb56d9bff819e003bbc2edc6e2e666b
Signed-off-by: hyesoo.yu <hyesoo.yu@samsung.com>
Janghyuck Kim [Mon, 21 May 2018 11:10:11 +0000 (20:10 +0900)]
[9610] arm64: dtsi: add scaler node
Change-Id: Ie5164db4a8607417b4c68fa34909028901ac4bc2
Signed-off-by: Janghyuck Kim <janghyuck.kim@samsung.com>
hyesoo.yu [Wed, 23 May 2018 07:49:36 +0000 (16:49 +0900)]
[9610] arm64: dtsi: add fimg2d node
Change-Id: I7f02f9f186453240cb1585077f88f0abc8e1cc8f
Signed-off-by: hyesoo.yu <hyesoo.yu@samsung.com>
Janghyuck Kim [Thu, 12 Apr 2018 06:18:12 +0000 (15:18 +0900)]
[COMMON] media: v4l2-core: fix compat ioctl
Copying reserved2 field was missed, and signedness of reserved2 field
was chagned. This patch corrected these bugs.
Change-Id: Ia04ead949d34c42392efab2200fc1ca78a0d64b8
Signed-off-by: Janghyuck Kim <janghyuck.kim@samsung.com>
Janghyuck Kim [Wed, 4 Apr 2018 06:54:14 +0000 (15:54 +0900)]
[COMMON] media: scaler: add V4L2_CAP_FENCES capability
Change-Id: I01879c9c5b6e439c8b53f8384092491d5e0814b6
Signed-off-by: Janghyuck Kim <janghyuck.kim@samsung.com>
Janghyuck Kim [Tue, 3 Apr 2018 06:47:28 +0000 (15:47 +0900)]
media: v4l2-core: fix v4l2-core to use fence
V4L2 explicit synchronization is supported by v4l2-core, however, some
changes were needed for compatiblity of other v4l2 driver.
fence_fd in v4l2_buffer is changed from reserved2 to reserved.
reserved2 field has been used for other driver, and legacy scaler driver
used reserved field for their fence information. This change could
guarantee compatibility of previous user API.
Some spinlock location of fence_cb_lock were moved to avoid running
buf_queue callback in interrupt context.
Finally, additional check routine was removed in vb2_buffer_done().
This routine made invalid address access, and it is used for unordered
queue. Currently it is not needed, so it will be reverted later after
find the reason of invalid address access.
Change-Id: I618b1d4320cfb95508727fc418ebe0f9fae7183a
Signed-off-by: Janghyuck Kim <janghyuck.kim@samsung.com>
Janghyuck Kim [Fri, 23 Mar 2018 09:48:12 +0000 (18:48 +0900)]
[media] v4l: Document explicit synchronization
Add section to VIDIOC_QBUF and VIDIOC_QUERY_BUF about it
v6: - Close some gaps in the docs (Hans)
v5:
- Remove V4L2_CAP_ORDERED
- Add doc about V4L2_FMT_FLAG_UNORDERED
v4:
- Document ordering behavior for in-fences
- Document V4L2_CAP_ORDERED capability
- Remove doc about OUT_FENCE event
- Document immediate return of out-fence in QBUF
v3:
- make the out_fence refer to the current buffer (Hans)
- Note what happens when the IN_FENCE is not set (Hans)
v2:
- mention that fences are files (Hans)
- rework for the new API
Change-Id: I011c3e013caed2431c330eed1afeb8f52fe52ddc
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.com>
Signed-off-by: Janghyuck Kim <janghyuck.kim@samsung.com>
Janghyuck Kim [Fri, 23 Mar 2018 09:46:26 +0000 (18:46 +0900)]
[media] v4l: introduce the fences capability
Drivers capable of using fences (vb2 drivers) should report the
V4L2_CAP_FENCES to userspace, so add this flag to the uapi.
Change-Id: I61d994bfb768aced3242c304d6e4f22a8d806b1d
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.com>
Signed-off-by: Janghyuck Kim <janghyuck.kim@samsung.com>
Janghyuck Kim [Fri, 23 Mar 2018 09:45:49 +0000 (18:45 +0900)]
[media] vb2: add out-fence support to QBUF
If V4L2_BUF_FLAG_OUT_FENCE flag is present on the QBUF call we create
an out_fence and send its fd to userspace on the fence_fd field as a
return arg for the QBUF call.
The fence is signaled on buffer_done(), when the job on the buffer is
finished.
v9: - remove in-fences changes from this patch (Alex Courbot)
- improve fence context creation (Hans Verkuil)
- clean up out fences if vb2_core_qbuf() fails (Hans Verkuil)
v8:
- return 0 as fence_fd if OUT_FENCE flag not used (Mauro)
- fix crash when checking not using fences in vb2_buffer_done()
v7:
- merge patch that add the infrastructure to out-fences into
this one (Alex Courbot)
- Do not install the fd if there is no fence. (Alex Courbot)
- do not report error on requeueing, just WARN_ON_ONCE() (Hans)
v6
- get rid of the V4L2_EVENT_OUT_FENCE event. We always keep the
ordering in vb2 for queueing in the driver, so the event is not
necessary anymore and the out_fence_fd is sent back to userspace
on QBUF call return arg
- do not allow requeueing with out-fences, instead mark the
buffer
with an error and wake up to userspace.
- send the out_fence_fd back to userspace on the fence_fd field
v5:
- delay fd_install to DQ_EVENT (Hans)
- if queue is fully ordered send OUT_FENCE event right away
(Brian)
- rename 'q->ordered' to 'q->ordered_in_driver'
- merge change to implement OUT_FENCE event here
v4:
- return the out_fence_fd in the BUF_QUEUED event(Hans)
v3: - add WARN_ON_ONCE(q->ordered) on requeueing (Hans)
- set the OUT_FENCE flag if there is a fence pending (Hans)
- call fd_install() after vb2_core_qbuf() (Hans)
- clean up fence if vb2_core_qbuf() fails (Hans)
- add list to store sync_file and fence for the next queued
buffer
v2: check if the queue is ordered.
Change-Id: I5c63827350c67ba703ce6a2b2fb4818bcc721846
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.com>
Signed-off-by: Janghyuck Kim <janghyuck.kim@samsung.com>
Janghyuck Kim [Fri, 23 Mar 2018 09:41:04 +0000 (18:41 +0900)]
[media] vb2: add in-fence support to QBUF
Receive in-fence from userspace and add support for waiting on them
before queueing the buffer to the driver. Buffers can't be queued to the
driver before its fences signal. And a buffer can't be queue to the
driver
out of the order they were queued from userspace. That means that even
if
it fence signal it must wait all other buffers, ahead of it in the
queue,
to signal first.
If the fence for some buffer fails we do not queue it to the driver,
instead we mark it as error and wait until the previous buffer is done
to notify userspace of the error. We wait here to deliver the buffers
back
to userspace in order.
v9: - rename fence to in_fence in many places
- handle fences signalling with error better (Hans Verkuil)
v8: - improve comments and docs (Hans Verkuil)
- fix unlocking of vb->fence_cb_lock on vb2_core_qbuf (Hans
Verkuil)
- move in-fences code that was in the out-fences patch here
(Alex)
v8: - improve comments about fences with errors
v7:
- get rid of the fence array stuff for ordering and just use
get_num_buffers_ready() (Hans)
- fix issue of queuing the buffer twice (Hans)
- avoid the dma_fence_wait() in core_qbuf() (Alex)
- merge preparation commit in
v6:
- With fences always keep the order userspace queues the
buffers.
- Protect in_fence manipulation with a lock (Brian Starkey)
- check if fences have the same context before adding a fence
array
- Fix last_fence ref unbalance in __set_in_fence() (Brian
Starkey)
- Clean up fence if __set_in_fence() fails (Brian Starkey)
- treat -EINVAL from dma_fence_add_callback() (Brian Starkey)
v5: - use fence_array to keep buffers ordered in vb2 core when
needed (Brian Starkey)
- keep backward compat on the reserved2 field (Brian Starkey)
- protect fence callback removal with lock (Brian Starkey)
v4:
- Add a comment about dma_fence_add_callback() not returning a
error (Hans)
- Call dma_fence_put(vb->in_fence) if fence signaled (Hans)
- select SYNC_FILE under config VIDEOBUF2_CORE (Hans)
- Move dma_fence_is_signaled() check to __enqueue_in_driver()
(Hans)
- Remove list_for_each_entry() in __vb2_core_qbuf() (Hans)
- Remove if (vb->state != VB2_BUF_STATE_QUEUED) from
vb2_start_streaming() (Hans)
- set IN_FENCE flags on __fill_v4l2_buffer (Hans)
- Queue buffers to the driver as soon as they are ready (Hans)
- call fill_user_buffer() after queuing the buffer (Hans)
- add err: label to clean up fence
- add dma_fence_wait() before calling vb2_start_streaming()
v3: - document fence parameter
- remove ternary if at vb2_qbuf() return (Mauro)
- do not change if conditions behaviour (Mauro)
v2:
- fix vb2_queue_or_prepare_buf() ret check
- remove check for VB2_MEMORY_DMABUF only (Javier)
- check num of ready buffers to start streaming
- when queueing, start from the first ready buffer
- handle queue cancel
Change-Id: I2c45f8f98e7d3a3026286e25934e64d0bebfc4f4
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.com>
Signed-off-by: Janghyuck Kim <janghyuck.kim@samsung.com>
Cosmin Tanislav [Wed, 17 Apr 2024 11:47:18 +0000 (14:47 +0300)]
Revert "media: videobuf2-core: dequeue if start_streaming fails"
This reverts commit
9e38c674ed71a7a05f9c35660951d0956134b6b2.
Janghyuck Kim [Fri, 23 Mar 2018 09:34:10 +0000 (18:34 +0900)]
[media] vb2: add explicit fence user API
Turn the reserved2 field into fence_fd that we will use to send
an in-fence to the kernel or return an out-fence from the kernel to
userspace.
Two new flags were added, V4L2_BUF_FLAG_IN_FENCE, that should be used
when sending a fence to the kernel to be waited on, and
V4L2_BUF_FLAG_OUT_FENCE, to ask the kernel to give back an out-fence.
v6: - big improvement on doc (Hans Verkuil)
v5:
- keep using reserved2 field for cpia2
- set fence_fd to 0 for now, for compat with userspace(Mauro)
v4:
- make it a union with reserved2 and fence_fd (Hans Verkuil)
v3:
- make the out_fence refer to the current buffer (Hans Verkuil)
v2: add documentation
Change-Id: Ic52ac856718b716c0eda3cae983e32817f09991e
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.com>
Signed-off-by: Janghyuck Kim <janghyuck.kim@samsung.com>
Janghyuck Kim [Fri, 23 Mar 2018 07:36:37 +0000 (16:36 +0900)]
[media] v4l: add 'unordered' flag to format description ioctl
For explicit synchronization it important for userspace to know if the
format being used by the driver can deliver the buffers back to
userspace
in the same order they were queued with QBUF.
Ordered streams fits nicely in a pipeline with DRM for example, where
ordered buffer are expected.
v2 - Improve documentation (Hans)
Change-Id: I5f0361407c7e50cf7eadb754bc977ed28de87527
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.com>
Signed-off-by: Janghyuck Kim <janghyuck.kim@samsung.com>
Janghyuck Kim [Fri, 23 Mar 2018 07:34:55 +0000 (16:34 +0900)]
[media] vb2: add is_unordered callback for drivers
Explicit synchronization benefits a lot from ordered queues, they fit
better in a pipeline with DRM for example so create a opt-in way for
drivers notify videobuf2 that the queue is unordered.
Drivers don't need implement it if the queue is ordered.
v2: - improve comments for is_unordered flag (Hans)
v3: - make it bool (Hans)
- create vb2_ops_set_unordered() helper
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.com>
Change-Id: I519c8576f2fd1b83e60a4da40c169b16b86ef825
Signed-off-by: Janghyuck Kim <janghyuck.kim@samsung.com>
Cho KyongHo [Thu, 22 Feb 2018 12:13:35 +0000 (21:13 +0900)]
v4l2-compat-ioctl32: copy extra v4l2_buffer fields from user
reserved field of v4l2_buffer structure delivers an acquire fence for
rendering devices implementing V4L2 for Android.
timecode, sequence and reserved2 fields of v4l2_buffer structure are
required by MFC driver and ExynosOMX.
Change-Id: Id1c7ef3b8b5d8574172d12ee52110d881e75585c
Signed-off-by: Cho KyongHo <pullip.cho@samsung.com>
Signed-off-by: CHOIHYOJOO <hyoj.choi@samsung.com>
Won Jung [Thu, 26 May 2016 13:19:35 +0000 (22:19 +0900)]
[COMMON] media: videobuf2-v4l2: fix bug for multiplane
In __fill_v4l2_buffer, q->is_multiplaner is used
to check whether multiplane is requested.
However, at this point, do not refer the condition
because it is not determined yet.
Therefore, using the macro, V4L2_TYPE_IS_MULTIPLANAR(), and
type, the member value in struct v4l2_buffer, the condition
(multiplane) is checked.
Change-Id: I84ce7a39020de53423ba094dd10fc712deba8d1b
Signed-off-by: Won Jung <w00.jung@samsung.com>
Jeonghee Kim [Fri, 26 Jan 2018 05:25:28 +0000 (14:25 +0900)]
[COMMON] media: videobuf2-v4l2: keep the reserved2 field
The reserved2 field should be keeped,
because this is used for extension interface
between user space and kernel space.
Change-Id: I9bb33d4ffa599f48b97c1604848ccdc4d0095310
Signed-off-by: Ayoung Sim <a.sim@samsung.com>
Signed-off-by: Jeonghee Kim <jhhhh.kim@samsung.com>
Cho KyongHo [Thu, 11 Jan 2018 00:51:20 +0000 (09:51 +0900)]
media: vb2: add support for iovmm in vb2-dma-sg
Address space management of DMA above System MMU in Exynos SoCs is not
constructed in dma-mapping but in iovmm that only provides address
space management for such DMAs. Therefore we should call iovmm_map()
and iovmm_unmap() explicitely even though videobuf2-dma-sg already
calls dma_map_sg() for mapping.
The client v4l2 drivers are intended to get DMA address from the
scatter-gather list returned by vb2_dma_sg_plane_desc() but
iovmm_map() leave it untouched because dma addresses in the scatter-
gather list is also used by cache maintenance. Therefore, DMA
addresses returned by iovmm_map() should be maintained separately.
We also provide vb2_dma_sg_plane_dma_addr() to find the DMA address
of a plane.
Change-Id: I4773d342716431d7ea889bb5e11ac3512d8193ba
Signed-off-by: Cho KyongHo <pullip.cho@samsung.com>
Janghyuck Kim [Thu, 15 Mar 2018 02:11:10 +0000 (11:11 +0900)]
[COMMON] media: scaler: add version information
Change-Id: Iebd38f9623354a45ea75dc88c0bdcef50fdc944c
Signed-off-by: Janghyuck Kim <janghyuck.kim@samsung.com>
Janghyuck Kim [Thu, 15 Mar 2018 02:09:21 +0000 (11:09 +0900)]
Revert "[COMMON] media: scaler: add debugging log for g2d power domain"
This reverts commit
5ea20f792414b4fb75c252f6accfe44e436c7233.
Change-Id: Idaa49e72fda38ee192fb86beacf02f8a6409b798
Signed-off-by: Janghyuck Kim <janghyuck.kim@samsung.com>
Cho KyongHo [Mon, 12 Feb 2018 05:26:33 +0000 (14:26 +0900)]
media: scaler: 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: I82d5d73ced2399c894bc2962198cd6e72fdb50f6
Signed-off-by: Cho KyongHo <pullip.cho@samsung.com>
Janghyuck Kim [Thu, 23 Nov 2017 08:14:15 +0000 (17:14 +0900)]
[COMMON] media: scaler: fix prevent issue
This patch fixed dead default in switch issue.
CID 197211
Change-Id: I1f3bec73cc6216e749ca603734e25e95752db56d
Signed-off-by: Janghyuck Kim <janghyuck.kim@samsung.com>
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>