summaryrefslogtreecommitdiffstats
path: root/drivers/media/platform/s5p-mfc/s5p_mfc_ctrl.c
Commit message (Collapse)AuthorAgeFilesLines
* [media] s5p-mfc: merge together s5p_mfc_hw_call and s5p_mfc_hw_call_voidAndrzej Hajda2015-12-231-8/+8
| | | | | | | | Both macros can be merged into one. Signed-off-by: Andrzej Hajda <a.hajda@samsung.com> Signed-off-by: Kamil Debski <k.debski@samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] s5p-mfc: fix a race in interrupt flags handlingPawel Osciak2014-10-281-2/+0Star
| | | | | | | | | | | | | | | | Interrupt result flags have to be cleared before a hardware job is run. Otherwise, if they are cleared asynchronously, we may end up clearing them after the interrupt for which we wanted to wait has already arrived, thus overwriting the job results that we intended to wait for. To prevent this, clear the flags only under hw_lock and before running a hardware job. Signed-off-by: Pawel Osciak <posciak@chromium.org> Signed-off-by: Kiran AVND <avnd.kiran@samsung.com> Signed-off-by: Arun Kumar K <arun.kk@samsung.com> Signed-off-by: Kamil Debski <k.debski@samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] s5p-mfc: modify mfc wakeup sequence for V8Arun Mankuzhi2014-10-281-17/+61
| | | | | | | | | | | MFC wakeup command has to be sent after the host receives firmware load complete status from risc. Signed-off-by: Arun Mankuzhi <arun.m@samsung.com> Signed-off-by: Kiran AVND <avnd.kiran@samsung.com> Signed-off-by: Arun Kumar K <arun.kk@samsung.com> Signed-off-by: Kamil Debski <k.debski@samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] s5p-mfc: declare s5p_mfc_bus_reset as staticMauro Carvalho Chehab2014-10-281-1/+1
| | | | | | | | drivers/media/platform/s5p-mfc/s5p_mfc_ctrl.c:132:5: warning: no previous prototype for 's5p_mfc_bus_reset' [-Wmissing-prototypes] int s5p_mfc_bus_reset(struct s5p_mfc_dev *dev) ^ Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] s5p-mfc: check mfc bus ctrl before resetKiran AVND2014-10-281-1/+24
| | | | | | | | | | | | | | during reset sequence, it is advisable to follow the below sequence, in order to avoid unexpected behavior from MFC . set SFR 0x7110 MFC_BUS_RESET_CTRL 0x1 // wait for REQ_STATUS to be 1 . get SFR 0x7110 MFC_BUS_RESET_CTRL 0x3 // reset now Signed-off-by: Kiran AVND <avnd.kiran@samsung.com> Signed-off-by: Arun Kumar K <arun.kk@samsung.com> Signed-off-by: Kamil Debski <k.debski@samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] s5p-mfc: keep RISC ON during reset for V7/V8Kiran AVND2014-10-281-10/+15
| | | | | | | | | | | | | Reset sequence for MFC V7 and V8 do not need RISC_ON to be set to 0, while for MFC V6 it is still needed. Also, remove a couple of register settings during Reset which are not needed from V6 onwards. Signed-off-by: Kiran AVND <avnd.kiran@samsung.com> Signed-off-by: Arun Kumar K <arun.kk@samsung.com> Signed-off-by: Kamil Debski <k.debski@samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] s5p-mfc: Fix several printk warningsMauro Carvalho Chehab2014-09-261-3/+3
| | | | | | | | | | | | | | drivers/media/platform/s5p-mfc/s5p_mfc_ctrl.c:192:3: warning: format ‘%x’ expects argument of type ‘unsigned int’, but argument 4 has type ‘dma_addr_t’ [-Wformat=] drivers/media/platform/s5p-mfc/s5p_mfc_ctrl.c:196:3: warning: format ‘%x’ expects argument of type ‘unsigned int’, but argument 4 has type ‘dma_addr_t’ [-Wformat=] drivers/media/platform/s5p-mfc/s5p_mfc_ctrl.c:196:3: warning: format ‘%x’ expects argument of type ‘unsigned int’, but argument 5 has type ‘dma_addr_t’ [-Wformat=] drivers/media/platform/s5p-mfc/s5p_mfc_dec.c:1206:4: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast] drivers/media/platform/s5p-mfc/s5p_mfc_dec.c:1206:32: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast] drivers/media/platform/s5p-mfc/s5p_mfc_enc.c:1757:3: warning: format ‘%zx’ expects argument of type ‘size_t’, but argument 6 has type ‘dma_addr_t’ [-Wformat=] drivers/media/platform/s5p-mfc/s5p_mfc_enc.c:1879:3: warning: format ‘%d’ expects argument of type ‘int’, but argument 5 has type ‘size_t’ [-Wformat=] drivers/media/platform/s5p-mfc/s5p_mfc_dec.c:1206:4: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast] drivers/media/platform/s5p-mfc/s5p_mfc_dec.c:1206:32: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast] Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] s5p-mfc: Fix sparse errors in the MFC driverKamil Debski2014-09-261-8/+8
| | | | | | | | | | | | | | | | | | | The following error: "error: incompatible types in conditional expression (different base types)" was reported multiple times for the s5p-mfc driver. This error was caused by two macro definitions - s5p_mfc_hw_call (in s5p_mfc_common.h) and WRITEL (in s5p_mfc_opr_v6.c). In the former case the macro assumed that all ops return a value, but some ops return void. The solution to this problem was the addition of a s5p_mfc_hw_call_void macro. In the latter case the macro used the ?: construction to check whether the address is non zero. This is not necessary after the driver left the development and debugging cycle, so the READL and WRITEL macros were removed. Signed-off-by: Kamil Debski <k.debski@samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] media: s5p-mfc: correct improper logsZhaowei Yuan2014-09-031-2/+2
| | | | | | | | This patch corrects improper logs within the code initializing hardware. Signed-off-by: Zhaowei Yuan <zhaowei.yuan@samsung.com> Signed-off-by: Kamil Debski <k.debski@samsung.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
* [media] s5p_mfc_ctrl: add missing s5p_mfc_ctrl.h headerMauro Carvalho Chehab2014-08-261-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | That gets rid of the following warnings: drivers/media/platform/s5p-mfc/s5p_mfc_ctrl.c:119:5: warning: no previous prototype for 's5p_mfc_release_firmware' [-Wmissing-prototypes] int s5p_mfc_release_firmware(struct s5p_mfc_dev *dev) ^ drivers/media/platform/s5p-mfc/s5p_mfc_ctrl.c:132:5: warning: no previous prototype for 's5p_mfc_reset' [-Wmissing-prototypes] int s5p_mfc_reset(struct s5p_mfc_dev *dev) ^ drivers/media/platform/s5p-mfc/s5p_mfc_ctrl.c:214:5: warning: no previous prototype for 's5p_mfc_init_hw' [-Wmissing-prototypes] int s5p_mfc_init_hw(struct s5p_mfc_dev *dev) ^ drivers/media/platform/s5p-mfc/s5p_mfc_ctrl.c:291:6: warning: no previous prototype for 's5p_mfc_deinit_hw' [-Wmissing-prototypes] void s5p_mfc_deinit_hw(struct s5p_mfc_dev *dev) ^ drivers/media/platform/s5p-mfc/s5p_mfc_ctrl.c:301:5: warning: no previous prototype for 's5p_mfc_sleep' [-Wmissing-prototypes] int s5p_mfc_sleep(struct s5p_mfc_dev *dev) ^ drivers/media/platform/s5p-mfc/s5p_mfc_ctrl.c:330:5: warning: no previous prototype for 's5p_mfc_wakeup' [-Wmissing-prototypes] int s5p_mfc_wakeup(struct s5p_mfc_dev *dev) ^ drivers/media/platform/s5p-mfc/s5p_mfc_ctrl.c:378:5: warning: no previous prototype for 's5p_mfc_open_mfc_inst' [-Wmissing-prototypes] int s5p_mfc_open_mfc_inst(struct s5p_mfc_dev *dev, struct s5p_mfc_ctx *ctx) ^ drivers/media/platform/s5p-mfc/s5p_mfc_ctrl.c:420:6: warning: no previous prototype for 's5p_mfc_close_mfc_inst' [-Wmissing-prototypes] void s5p_mfc_close_mfc_inst(struct s5p_mfc_dev *dev, struct s5p_mfc_ctx *ctx) ^ Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
* [media] s5p-mfc: Support multiple firmware sub-versionsArun Kumar K2014-07-221-3/+12
| | | | | | | | | | | | | | | | | For MFC firmwares, improved versions with bug fixes and feature additions are released keeping the firmware version including major and minor number same. The issue came with the release of a new MFCv6 firmware with an interface change. This patch adds the support of accepting multiple firmware binaries for every version with the driver trying to load firmwares starting from latest. This ensures full backward compatibility regardless of which firmware version and kernel version is used. Signed-off-by: Arun Kumar K <arun.kk@samsung.com> Reviewed-by: Tomasz Figa <t.figa@samsung.com> Signed-off-by: Kamil Debski <k.debski@samsung.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
* [media] s5p-mfc: Remove duplicate function s5p_mfc_reload_firmwareArun Kumar K2014-07-221-33/+0Star
| | | | | | | | | | The function s5p_mfc_reload_firmware is exactly same as s5p_mfc_load_firmware. So removing the duplicate function. Signed-off-by: Arun Kumar K <arun.kk@samsung.com> Reviewed-by: Tomasz Figa <t.figa@samsung.com> Signed-off-by: Kamil Debski <k.debski@samsung.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
* [media] s5p: fix error code path when failing to allocate DMA memoryMaurizio Lombardi2014-07-211-3/+2Star
| | | | | | | | | | | | | | In the s5p_mfc_alloc_firmware() function there are some mistakes where the code checks whether the DMA memory is properly allocated or not. First of all dma_alloc_coherent() returns NULL in case of error. The code also checked two times fw_virt_addr, ignoring the bank2_virt pointer. Signed-off-by: Maurizio Lombardi <mlombard@redhat.com> Signed-off-by: Kamil Debski <k.debski@samsung.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
* [media] s5p-mfc: Don't allocate codec buffers on STREAMONPawel Osciak2014-05-231-0/+1
| | | | | | | | | | | | | | | | Currently, we allocate private codec buffers on STREAMON, which may fail if we are out of memory. We don't check for failure though, which will make us crash with the codec accessing random memory. We shouldn't be failing STREAMON with out of memory errors though. So move the allocation of private codec buffers to REQBUFS for OUTPUT queue. Also, move MFC instance opening and closing to REQBUFS as well, as it's tied to allocation and deallocation of private codec buffers. Signed-off-by: Pawel Osciak <posciak@chromium.org> Signed-off-by: Arun Kumar K <arun.kk@samsung.com> Signed-off-by: Kamil Debski <k.debski@samsung.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
* [media] s5p-mfc: Extract open/close MFC instance commandsPawel Osciak2014-05-231-0/+61
| | | | | | | | | | This is in preparation for a new flow to fix issues with streamon, which should not be allocating buffer memory. Signed-off-by: Pawel Osciak <posciak@chromium.org> Signed-off-by: Arun Kumar K <arun.kk@samsung.com> Signed-off-by: Kamil Debski <k.debski@samsung.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
* [media] s5p-mfc: remove meaningless memory bank assignmentSeung-Woo Kim2014-03-111-2/+0Star
| | | | | | | | | This patch removes meaningless assignment of memory bank to itself. Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com> Acked-by: Sachin Kamat <sachin.kamat@linaro.org> Signed-off-by: Kamil Debski <k.debski@samsung.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
* [media] media_tree: Fix spelling errorsJonathan McCrohan2013-11-291-1/+1
| | | | | | | | | | | | Fix various spelling errors in strings and comments throughout the media tree. The majority of these were found using Lucas De Marchi's codespell tool. [m.chehab@samsung.com: discard hunks with conflicts] Signed-off-by: Jonathan McCrohan <jmccrohan@gmail.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
* [media] s5p-mfc: Rename IS_MFCV6 macroArun Kumar K2013-08-181-6/+6
| | | | | | | | | | | | The MFC v6 specific code holds good for MFC v7 also as the v7 version is a superset of v6 and the HW interface remains more or less similar. This patch renames the macro IS_MFCV6() to IS_MFCV6_PLUS() so that it can be used for v7 also. Signed-off-by: Arun Kumar K <arun.kk@samsung.com> Signed-off-by: Kamil Debski <k.debski@samsung.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
* [media] s5p-mfc: Add NULL check for allocated bufferSachin Kamat2013-06-031-1/+1
| | | | | | | | | In certain cases, dma_alloc_coherent returns NULL. Add check for NULL pointer. Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> Signed-off-by: Kamil Debski <k.debski@samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* [media] s5p-mfc: Fix a watchdog bugKamil Debski2013-02-051-1/+1
| | | | | | | | | Fixed wrong condition in firmware reload function used by the watchdog. Signed-off-by: Kamil Debski <k.debski@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* [media] s5p-mfc: Move firmware allocation point to avoid allocation problemsKamil Debski2013-01-061-80/+69Star
| | | | | | | | | | | Move firmware allocation from open to probe to avoid problems when using CMA for allocation. In certain circumstances CMA may allocate buffer that is not in the beginning of the MFC memory area. Signed-off-by: Kamil Debski <k.debski@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* [media] s5p-mfc: Update MFC v4l2 driver to support MFC6.xJeongtae Park2012-10-061-55/+107
| | | | | | | | | | | | | | | Multi Format Codec 6.x is a hardware video coding acceleration module present in new Exynos5 SoC series. It is capable of handling several new video codecs for decoding and encoding. Signed-off-by: Jeongtae Park <jtp.park@samsung.com> Signed-off-by: Janghyuck Kim <janghyuck.kim@samsung.com> Signed-off-by: Jaeryul Oh <jaeryul.oh@samsung.com> Signed-off-by: Naveen Krishna Chatradhi <ch.naveen@samsung.com> Signed-off-by: Arun Kumar K <arun.kk@samsung.com> Acked-by: Kamil Debski <k.debski@samsung.com> Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* [media] s5p-mfc: Add MFC variant data to device contextArun Kumar K2012-10-061-1/+6
| | | | | | | | | | | | | | | MFC variant data replaces various macros used in the driver which will change in a different version of MFC hardware. Also does a cleanup of MFC context structure and common files. Signed-off-by: Jeongtae Park <jtp.park@samsung.com> Signed-off-by: Janghyuck Kim <janghyuck.kim@samsung.com> Signed-off-by: Jaeryul Oh <jaeryul.oh@samsung.com> Signed-off-by: Naveen Krishna Chatradhi <ch.naveen@samsung.com> Signed-off-by: Arun Kumar K <arun.kk@samsung.com> Acked-by: Kamil Debski <k.debski@samsung.com> Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* [media] s5p-mfc: Update MFCv5 driver for callback based architectureArun Kumar K2012-10-061-12/+23
| | | | | | | | | | | | Modifies the driver to use a callback based architecture for hardware dependent calls. This architecture is suitable for supporting co-existence with newer versions of MFC hardware. Signed-off-by: Arun Kumar K <arun.kk@samsung.com> Signed-off-by: Naveen Krishna Chatradhi <ch.naveen@samsung.com> Acked-by: Kamil Debski <k.debski@samsung.com> Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* [media] s5p-mfc: Prepare driver for callback based re-architectureArun Kumar K2012-10-061-1/+1
| | | | | | | | | | | | The patch renames hardware specific opr and cmd files to opr_v5 and cmd_v5 respectively. This is done for accomodating firmware v6. Also the shared memory management files are removed and the functionality is added to the opr_v5 file. Signed-off-by: Arun Kumar K <arun.kk@samsung.com> Acked-by: Kamil Debski <k.debski@samsung.com> Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* [media] s5p-mfc: added support for end of stream handling in MFC encoderAndrzej Hajda2012-10-021-1/+5
| | | | | | | | | | | | s5p-mfc encoder after receiving V4L2_ENC_CMD_STOP command will instruct MFC device to release all encoded frames. After dequeuing last encoded frame driver will generate V4L2_EVENT_EOS event. Signed-off-by: Andrzej Hajda <a.hajda@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* [media] s5p-mfc: Fix second memory bank alignmentKamil Debski2012-10-011-1/+1
| | | | | | | Signed-off-by: Kamil Debski <k.debski@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* [media] rename drivers/media/video as .../platformMauro Carvalho Chehab2012-08-151-0/+343
The remaining drivers are mostly platform drivers. Name the dir to reflect it. It makes sense to latter break it into a few other dirs. Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>