Commit graph

5194 commits

Author SHA1 Message Date
Rahul Sharma
5e597b465b msm: vidc: prevent vcd_stop to wait for long
Video decoder release calls vid_dec_close_client which calls vcd_stop.
If vcd_stop notification fails, then there is a long wait. This patch
is limiting the same

Change-Id: Ibdf33e3882826429bf8c49a5888b8c9908e2e62d
Signed-off-by: Rahul Sharma <sharah@codeaurora.org>
2018-08-27 14:52:38 +00:00
wyun
53010ac515 msm: vidc: Enable dynamic debug level & out for video kernel driver
"level" has an option of FATAL, ERROR, HIGH, MED, LOW.
  >>usage for all levels: adb shell "echo 0xF > /d/vidc/vidc_debug_level"
"out" has an option of printk or trace_printk.
  >>usage for terminal window: adb shell "echo 1 > /d/vidc/vidc_debug_out"

Change-Id: I0ea3ed2999cc80e691ea86667401eff6c1bf88a8
Signed-off-by: wyun@codeaurora.org
2018-08-27 14:52:37 +00:00
Shiju Mathew
1ecc53d36d msm: vidc: Add support for Picture Order Count Type
This patch adds POC type support for video core that
enables low-latency encoding.

Change-Id: I1fe8ea38c7ed8d203a3ef99febb4001165a856fe
Signed-off-by: Shiju Mathew <shijum@codeaurora.org>
2018-08-27 14:52:37 +00:00
c_sridur
e3f2503670 msm_vidc: Frame height is not updating for low resolution clip
Fix: Update frame height preoperly for height lesser than 64

Change-Id: I17cf166a40f77fcea74e7d0c19af801e6e6244d5
Signed-off-by: c_sridur <sridur@codeaurora.org>
2018-08-27 14:52:37 +00:00
Prados Das
a534d63a4c Revert "msm: vidc: No need to allocate metadata by default"
This reverts commit 0efc959be55801808454292cc61d11ff8ab1bfa1

Change-Id: I08163ac9e4d4481cb9df324fd8ccc14bef536d96
Signed-off-by: Prados Das <prados@codeaurora.org>
2018-08-27 14:52:36 +00:00
Deepak Verma
c5aa9f6b0e msm: vidc: No need to allocate metadata by default
If metadata is not enabled by client, there is no need
to enable it by default.

Change-Id: I6d5bd1c04dcdf78549afac57bcaceb82602da270
Signed-off-by: Deepak Verma <dverma@codeaurora.org>
2018-08-27 14:52:36 +00:00
srikarri
b4cae04f14 msm: vidc: enable pic_order_cnt_type for H264 encoding
-current implementation will result in poc_type as 0 in SPS
params (even though the poc increment value is 2 in the
encoded stream).
-So changes done to return poc_type as 2 in SPS params

Change-Id: I5a22af422b0e1591a69a0b5b868342667ee60bbf
Signed-off-by: srikarri <sridur@codeaurora.org>
2018-08-27 14:52:36 +00:00
Deepak Verma
199e7908cf msm: vidc: Set input buffer size dynamically
This change supports overriding of default input
buffer size using a set parameter call from the
client.

Change-Id: I5225ec53ba16b68aeedd4c30897bd291e81b4b09
Signed-off-by: Deepak Verma <dverma@codeaurora.org>
2018-08-27 14:52:35 +00:00
Deepak Verma
446bc8aa6e msm: vidc: Initialize kernel space stack variables
This change initializes kernel space stack variables
that are passed between kernel space and user space
using ioctls.
Non initialization of these variables may lead to
leakage of memory values from the kernel stack to
user space.

Change-Id: Icb195470545ee48b55671ac09798610178e833e1
CRs-fixed: 556771,563420
Signed-off-by: Deepak Verma <dverma@codeaurora.org>
2018-08-27 14:52:35 +00:00
Deepak Verma
889ead1155 msm: vidc: Validate input data before processing
User controlled data needs to be validated before
processing, otherwise it may corrupt existing data
and other programming variables which may further
lead to crash in kernel space.
This change validates user specified buffer's data,
such as offset and data length, before performing
any operations in kernel.

Change-Id: Idb2a5c4c270cdbb55adfc0c22b9296b7dd359de9
CRs-fixed: 547695
Signed-off-by: Deepak Verma <dverma@codeaurora.org>
2018-08-27 14:52:35 +00:00
srikarri
e08007f901 msm: vidc: free the recon buffers in cleanup function
- The recon buffers were not released when video recording
  was killed abruptly leading to memory leak.

- Fix provided to release the recon buffers when media
  server killed abruptly.

Change-Id: I48ac1a592719446b7e4bf87bbd707d09351d1e61
Signed-off-by: srikarri <sridur@codeaurora.org>
2018-08-27 14:52:34 +00:00
Mayank Chopra
e92f596664 msm_fb: display: Add support to YCBYCR MDP format
Add support of MDP_YCBYCR_H2V1 interleaved YUV format to MDP
for a-family targets.

Change-Id: I5afb84a95693d1ced114152364782a10c4d56bc2
Signed-off-by: Mayank Chopra <makchopra@codeaurora.org>
2018-08-27 14:52:33 +00:00
Vishnuvardhan Prodduturi
46076762d6 msm: msm_fb: Replace wait for DMA_P with VSYNC in Pan_display Path.
This is a follow up change on gerrit 442946. Wait for DMA_P has to be
replaced with VSYNC even in Pan Display Path.

Change-Id: I8d600022cfa63f54d5b72ea5f64fc55315079b3a
Signed-off-by: Vishnuvardhan Prodduturi <vproddut@codeaurora.org>
2018-08-27 14:52:33 +00:00
Vishnuvardhan Prodduturi
77e93ca69c msm: msm_fb: wait for VSYNC instead of DMA_P for commit completion.
In the current implementation, we are waiting for DMA_P interrupt
in commit call to signal completion. This can cause 2 commits happening
in the same vsync period due to which IOMMU page faults can happen when
vsync comes while second commit is programming resgisters. To avoid this,
wait for DMA_P is replaced by wait for VSYNC.

Change-Id: I68d4d4b4e7a574f86faecd5b4812e1f5852f4209
Signed-off-by: Vishnuvardhan Prodduturi <vproddut@codeaurora.org>
2018-08-27 14:52:33 +00:00
Maheshwar Ajja
3c4ccf282e msm: vidc: Add LTR feature for H264 encoder
This change adds Long Term Reference picture
selection feature for H264 video encoder.

Change-Id: Ida957df244d8715c955afe8d809708123a94e999
Signed-off-by: Maheshwar Ajja <majja@codeaurora.org>
2018-08-27 14:52:32 +00:00
Maheshwar Ajja
50f8458679 msm: vidc: Memset and flush codec context buffers
This change will memset and flush the codec context
buffers for non-secure case to resolve video driver
timer expire issues.

Change-Id: I6669481da3076a392061868475fc9844f2c41064
Signed-off-by: Maheshwar Ajja <majja@codeaurora.org>
2018-08-27 14:52:28 +00:00
Mayank Chopra
31456ea019 msm_fb: display: Fix interleaved 422 input format register settings
Check to update chroma sample information in source format register is
based on fetch plane value, which does not take into account for
interleaved 422 input format. Remove this check and set chroma sample
values for RGB formats as well.

CRs-Fixed: 501035
Change-Id: If8fd47b6d47b326efd1cb70ce9701ac1d457dcfd
Signed-off-by: Mayank Chopra <makchopra@codeaurora.org>
Signed-off-by: Padmanabhan Komanduru <pkomandu@codeaurora.org>
2018-08-27 14:52:27 +00:00
Mayank Goyal
60e928abe0 msm: rotator: Add pseudo-planar 422 H1V2 dst format for MDP4
Rotator outputs pseudo-planar 422 H1V2 for interleaved inputs
on 90 degree rotation.Add changes to support MDP_Y_CRCB_H1V2,
MDP_Y_CBCR_H1V2 in MDP4.

CRs-Fixed: 371303
Change-Id: I42ea86992fc77cd335437a47611e9f640f30ed25
Signed-off-by: Mayank Goyal <goyalm@codeaurora.org>
Signed-off-by: Mayank Chopra <makchopra@codeaurora.org>
Signed-off-by: Padmanabhan Komanduru <pkomandu@codeaurora.org>
2018-08-27 14:52:27 +00:00
Mayank Chopra
4cbef40a63 msm_fb: display: Add pseudo-planar 422 H1V2 support in the MDP4
Rotator outputs pseudo-planar 422 H1V2 for interleaved inputs
on 90 degree rotation. Add changes to support MDP_Y_CRCB_H1V2
in MDP4.

CRs-Fixed: 371303
Signed-off-by: Mayank Chopra <makchopra@codeaurora.org>

Conflicts:

	drivers/video/msm/mdp4_overlay.c

Change-Id: I730a3196df8d0c204e6334c2c8b9199d15cbb16a
Signed-off-by: Mayank Chopra <makchopra@codeaurora.org>
Signed-off-by: Padmanabhan Komanduru <pkomandu@codeaurora.org>
2018-08-27 14:52:27 +00:00
Maheshwar Ajja
1f9b4f459a msm: vidc: Amend error check conditions on ION APIs
Amend error check conditions appropriately to return
properly from video applications in case of ION API
failures.

Change-Id: Ibe95a8438a66e88b35dbff0af8842ff4b038c5e1
Signed-off-by: Maheshwar Ajja <majja@codeaurora.org>
2018-08-27 14:52:25 +00:00
Maheshwar Ajja
6a9440707a msm: vidc: Get the current performance level
This change supports client to get the current
performance level of the video driver via
IOCTL_GET_PERF_LEVEL. The current performance
level indicate the number of MBs per second
is being processed by video hardware.

Change-Id: Ic6f5b2b14e0d77bf801c4f857f8a0e20339c199f
Signed-off-by: Maheshwar Ajja <majja@codeaurora.org>
2018-08-27 14:52:25 +00:00
Maheshwar Ajja
fc9cab72cb msm: vidc: Handle mgen2maxi interrupt in video driver
Handle interrupt generated by mgen2maxi h/w and
avoid unknown interrupts storm which results in
target reset issues.

Change-Id: Ida24cb2dde15c9cd4a4c1d9ca336b1a4b662c4d1
Signed-off-by: Maheshwar Ajja <majja@codeaurora.org>
Signed-off-by: Sridhar Gujje <sgujje@codeaurora.org>
2018-08-27 14:52:24 +00:00
Maheshwar Ajja
f675bfaac7 msm: vidc: Allow client to set turbo mode
- Allow client to set TURBO performance level
  to video driver.
- Update max performance level to TURBO perf level
  on supported targets.

Change-Id: I0b3b38140d777984ba5062ddd614c07a002389ba
Signed-off-by: Maheshwar Ajja <majja@codeaurora.org>
Signed-off-by: Sridhar Gujje <sgujje@codeaurora.org>
2018-08-27 14:52:24 +00:00
Maheshwar Ajja
f897cdbb4f msm: vidc: Remove unncessary unmap function calls
Calling unncessary unmap function resulting in
target reset. This change resolves the issue by
removing unncessary unmap functions in video driver.

Change-Id: I0b501f0a7115bba085b067a5e78172df210da8f1
Signed-off-by: Maheshwar Ajja <majja@codeaurora.org>
Signed-off-by: Sridhar Gujje <sgujje@codeaurora.org>
2018-08-27 14:52:24 +00:00
Maheshwar Ajja
d9108943e8 msm: vidc: Optimize IOMMU map size for H264 decoder
IOMMU map size is not required to be double the actual
buffer size for H264 decoder. So reducing IOMMU map
size for H264 format which will enable support for
two H264 decoder instances in parallel in smooth streamig
mode where the number of output buffers equal to 18 with
each buffer size equal to 1080p buffer size.

CRs-fixed: 491718
Change-Id: Ie6782b2ff58667000213f25482eea151b849762b
Signed-off-by: Maheshwar Ajja <majja@codeaurora.org>
2018-08-27 14:52:23 +00:00
Srinu Gorle
0460f7ed8a msm: vidc: Remove unwanted error message
This change removes unwanted error message about video
clock settings.

Change-Id: I49f30d681366e07a2e002a9df58460962fd12318
CRs-Fixed: 488058
Signed-off-by: Srinu Gorle <sgorle@codeaurora.org>
Signed-off-by: Deepak Verma <dverma@codeaurora.org>
2018-08-27 14:52:23 +00:00
Deepak Verma
906f07db65 msm: vidc: Set extradata flag properly
Extradata flag is not set to output buffer header's flag in
case when a Mpeg2 clip is played and extenstion and user data
extradata is not enabled.
This change fixes the issue and set extradata flag properly
if extradata is enabled and extradata is available with the
the buffer.

CRs-fixed: 490067
Change-Id: I029dadb17d98dd37388eee34f51bd0dfaf56d14a
Signed-off-by: Deepak Verma <dverma@codeaurora.org>
2018-08-27 14:52:22 +00:00
Srinu Gorle
0497ffd266 msm: vidc: Do not reset VCD_FRAME_FLAG_DATACORRUPT flag for VC1
- To propagate VCD_FRAME_FLAG_DATACORRUPT flag to IL client, dont reset.

Change-Id: I68bf4c953c02a2a4327fe6e875863853cb4e0bf8
CRs-Fixed: 472798
Signed-off-by: Srinu Gorle <sgorle@codeaurora.org>
2018-08-27 14:52:22 +00:00
Shobhit Pandey
687aa8293f msm: vidc: Fix compilation errors
This change removes the compilation error in kernel
if ddl logs are enabled.

CRs-Fixed: 483776
Change-Id: Iffc37fcdd4e5ce7ddcd8560d432af5c3f3e6c433
Signed-off-by: Shobhit Pandey <cshopan@codeaurora.org>
2018-08-27 14:52:22 +00:00
Maheshwar Ajja
4dec300645 msm: vidc: Update sub_anchor_mv buffer size
The sub_anchor_mv size is not sufficient if the height
is more than 1088 in video clips, this change will amend
the buffer size to avoid video hardware resulting iommu
crash failures for such clips.

Change-Id: Ie59f04b9edaa9d2364d4e5014d2eb6f882728c76
Signed-off-by: Maheshwar Ajja <majja@codeaurora.org>
2018-08-27 14:52:21 +00:00
Shobhit Pandey
6079d5980d msm: vidc: Correct log tagging for kernel messages
This change amends the log tagging in kernel.

CRs-fixed: 478607
Change-Id: I2c7056d8fc9ec82ffbc6824790c064033481a9af
Signed-off-by: Shobhit Pandey <cshopan@codeaurora.org>
2018-08-27 14:52:21 +00:00
Maheshwar Ajja
37560cd750 msm: vidc: Free buffer pool entry and then delete address table
Free the buffer pool entry first and then delete the
address table (which will unmap the buffer with iommu)
else we might get a corner case where the entry was not
freed but the buffer is unmapped and the next buffer is
mapped with the same physical address which is still
available in the buffer pool entry, which results in
video recording failure.

Change-Id: I6978d5e5de35db63f43a7f38c58940216217b676
Signed-off-by: Maheshwar Ajja <majja@codeaurora.org>
2018-08-27 14:52:21 +00:00
Maheshwar Ajja
f3401f6214 msm: vidc: Fix metadata buffer size issue
- Metadata buffer size is being set to zero when
  client calls set buffer requirements to video driver.
  This change fix it by properly assigning the
  metadata buffer size to video driver.
- When continuous mode enabled, do not get min_dpb
  from resource tracker for non-H264 codecs,
  for H264 codec get min_dpb from resource tracker.

Change-Id: Ie16bc47605edc6f67dbf3ae77290d4d764c5c613
Signed-off-by: Maheshwar Ajja <majja@codeaurora.org>
2018-08-27 14:52:20 +00:00
Deva Ramasubramanian
b96b3c149c msm: vidc: Invalidate cache when allocating buffers
We need to remove stale entries in the cache when allocating buffers, as
the ION driver doesn't invalidate the cache.

CRs-Fixed: 456500
Change-Id: Ibe931251b6f06c6acbe6bc8a095b0e925dc08857
Signed-off-by: Rajeshwar Kurapaty <rkurapat@codeaurora.org>
2018-08-27 14:52:20 +00:00
Gopikrishnaiah Anandan
c5fd0178be vidc: Handle descriptor buffer error as warning
Driver will consider descriptor buffer empty error
as warning and will continue to decode next frame.

Change-Id: Ia89ea520131f9b3e1bbe68727c34fb72685d5af9
Signed-off-by: Gopikrishnaiah Anandan <agopik@codeaurora.org>
2018-08-27 14:52:20 +00:00
Deepak Verma
6cf557f388 msm: vidc: Free meta buffers during address table cleanup
This change frees the allocated meta buffers, if any
present, during video core address table cleanup.

Change-Id: Id8c42491040bc5be09f3bb59780d376e6921c76e
CRs-fixed: 459980
Signed-off-by: Deepak Verma <dverma@codeaurora.org>
2018-08-27 14:52:19 +00:00
Maheshwar Ajja
3028d662ac msm: vidc: Remove delayed unmap flag in ion_map_iommu()
This change fixes the iommu map failure in movie studio
application by removing the delayed unmap flag in
ion_map_iommu(). The delayed unmap will cause the
iommu buffer to be unmapped only when all the clients
unmap the buffer.

Change-Id: I9e226fd56fecfa292e4d77aa94b2883bcfbf6ec2
CRs-fixed: 464374
Signed-off-by: Maheshwar Ajja <majja@codeaurora.org>
2018-08-27 14:52:19 +00:00
Maheshwar Ajja
a094b332dc msm: vidc: Remove kernel mapping on input/output buffers
This change will remove the kernel mapping of input and
output buffers for both video encoder and decoder to
avoid the errors resulting from ion_map_kernel() for
high resolution video concurrency use cases due to the
limited vmalloc space. It also removed the metadata
processing in kerner video driver as kernel virtual
address is removed. The metadata processing can be
done in user space video component.

Change-Id: I3f2c9b7c13b3e09097ce07ca7b59154b97401052
CRs-fixed: 471135
Signed-off-by: Maheshwar Ajja <majja@codeaurora.org>
2018-08-27 14:52:18 +00:00
Arne Coucheron
f715505de6 Revert "msm: mdp: Update sync pt. behaviour"
* Commit "egl: Avoid use of retire as present"
    in frameworks/native deprecated the use
    of retire fence, therefore retire fence
    support has to be removed from the kernel
    to allow HWC2on1Adapter support

This reverts commit fd75d86c883b7a6852d8d291b58203b0999a1584.
Change-Id: I19877296ac762e4d5c3162843ccaf5cc9a88ff1c
Signed-off-by: Adrian DC <radian.dc@gmail.com>
2018-08-27 14:52:16 +00:00
Artem Borisov
d7992e6feb Merge remote-tracking branch 'stable/linux-3.4.y' into lineage-15.1
All bluetooth-related changes were omitted because of our ancient incompatible bt stack.

Change-Id: I96440b7be9342a9c1adc9476066272b827776e64
2017-12-27 17:13:15 +03:00
Steve Pfetsch
d39b8b9e21 drivers: video: Add bounds checking in fb_cmap_to_user
Verify that unsigned int value will not become negative before cast to
signed int.

Bug: 31651010
Change-Id: I548a200f678762042617f11100b6966a405a3920
2016-12-22 22:05:10 +11:00
Ping Li
1180db142c fbcmap: Remove unnecessary condition check
In fb_set_user_cmap function, cmap->start variable is an unsigned
integer, it doesn't need a condition check with the sign.

Change-Id: I355ddb7edcc085ee52e4054833b687640376eee3
Signed-off-by: Ping Li <pingli@codeaurora.org>
2016-12-22 22:05:10 +11:00
Pawan Kumar
423ee25484 fbmem: Check failure of FBIOPUTCMAP ioctl
On FBIOPUTCMAP ioctl failure deallocate
fb cmap. Put null check for cmap red, green,
blue component.

Change-Id: I10468ee30d0e76c256cf3d7a6ffe14db7fd4511b
Signed-off-by: Pawan Kumar <pavaku@codeaurora.org>
2016-12-22 22:05:09 +11:00
Simon Shields
80f93fb9a3 Revert "Revert "video: mdp4: Color temperature interface using PCC""
This reverts commits c4e35c98f4,
c4e35c98f4.

Change-Id: I50e44e0c24144a04347760313e5dae576e6704e3
2016-11-28 21:01:22 +11:00
Simon Shields
c4e35c98f4 Revert "video: mdp4: Color temperature interface using PCC"
This reverts commit ecf3da5bd5.

Change-Id: I5a8daa6b8d52f71a6c4aabf801ecb70b7d1b83fa
2016-11-23 16:02:54 -08:00
Simon Shields
191b2f2b60 Revert "mdp4: pcc: fix PCC disablement"
This reverts commit 52d9e81de2.

Change-Id: I30adec69a9db3235c1399a8b6681603d4f5cc089
2016-11-23 16:02:30 -08:00
Dave Daynard
52d9e81de2 mdp4: pcc: fix PCC disablement
MDP_PP_OPS_DISABLE flag doesn't exist on A family, using it actually
completely disables PCC

Change-Id: Ib174ca08f634f9b256178f977bd5d59db751ef7c
2016-11-19 18:43:10 +11:00
Steve Kondik
ecf3da5bd5 video: mdp4: Color temperature interface using PCC
* MDP 4.2 supports Polynomial Color Correction. Use this to implement
   a simple sysfs API for adjusting RGB scaling values. This can be
   used to implement color temperature and other controls.
* Why use this when we have KCAL? This code is dead simple, the
   interface is in the right place, and it allows for 128X accuracy.

Change-Id: Iefb17e920225234d8503607bccb2d128bf5ec660
2016-11-19 18:43:10 +11:00
Camus Wong
20419b715d msm: fb: return error if overlay set during display power off
When display is suspended, driver shouldn't return any resource
back for overlay set.

Change-Id: I8a69efa519ea9a566897b69e345680a2a619fe54
Signed-off-by: Camus Wong <camusw@codeaurora.org>
[zhaoweiliew: Convert panel suspend check references to new ones]
Signed-off-by: Zhao Wei Liew <zhaoweiliew@gmail.com>
2016-10-29 23:12:37 +08:00
Ethan Chen
b6f29d6f95 msm: mdp: Add support for display always on mode
* Add a new panel power state to represent a panel low power mode.

Change-Id: Ie307012ddd62f9690b99b44c3efd9cac6895beb1
[zhaoweiliew: Convert more panel mode references]
Signed-off-by: Zhao Wei Liew <zhaoweiliew@gmail.com>
2016-10-29 23:12:37 +08:00