OMAPDSS: DSSCOMP: efficiency improvement.

This change adds 3 local caches of objects, which are used at each flip buffer
action. In original variant kzalloc()/kfree() functions are called each time
dsscomp_gralloc_queue() function is called. This meens that slab|slob|slub
common cache is used at each frame draw action. Call to kzalloc()/kfree()
result in synchronization with other code, which uses common cache, and can
result in dips in FPS, when other code allocates/frees memory.
This change improves reliability, autonomy and efficiency of DSSCOMP module.

Change-Id: Id50778f4579309fb71318a32820b9d6441a6dac1
Signed-off-by: Mykhailo Denysiuk <x0172934@ti.com>
Signed-off-by: Dan Trifan <jimsth@gmail.com>
OMAPDSS: DSS: Scale DSS OPP according to pixel clock rate

Before enabling pixel clock DSS should set its OPP
for OPP framework to set correct VDD_CORE voltage level.

When pixel clock is disabled DSS can set the lowest OPP.

Change-Id: Ia1459614ae306dba9b048b149e474442e2880bba
Signed-off-by: Taras Kondratiuk <taras@ti.com>
Signed-off-by: Dan Trifan <jimsth@gmail.com>

Conflicts:
	drivers/video/omap2/dss/dsi.c

Signed-off-by: Dan Trifan <jimsth@gmail.com>
OMAPDSS: DISPC: Pipe threshold sizes power optimization.

This patch changes the calculation of thresholds and sets low
threshold to half of buffer size for OMAP4. The memory will
able to sleep between transactions to dss because dss will
read by big chunks.

boype: Also removed dispc_calculate_threshold function, as it is no longer used.

Backport from TI omapzoom kernel 3.4 repo, based upon:
http://git.omapzoom.org/?p=kernel/omap.git;a=commit;h=cd99eb345e1ad26ffbc665f46ea917dad762937b

Signed-off-by: Dan Trifan <jimsth@gmail.com>
OMAPDSS: drop small YUV encoded frames on OMAP44xx

OMAP44xx has hardware limitation: in stall mode, when the frame pixel size
is less than output SyncFifo depth(16), DISPC hangs without sending any data.
Simple workaround is to drop such frame, as cases when YUV frames of this size
are very rare.

Change-Id: I31dc262b07a52b66209c093f136ad2bac66f9439
Signed-off-by: Sergiy Kibrik <sergiy.kibrik@globallogic.com>
Signed-off-by: Dan Trifan <jimsth@gmail.com>
panel-s6e8aa0: fix slightly inaccurate pixel clock

Signed-off-by: Dan Trifan <jimsth@gmail.com>
OMAPDSS: DISPC: fix pclk divisor limits

According to TRM, minimal pixel clock divisor value can be 1.
Fix corresponding checks, as high resolution panels use undivided
pixel clock frequency.

Also certain scaler unit constraint must be met: in case DISPC_CLK
and pixel clock frequencies are equal, set IPC to work on rising edge.

Change-Id: Iabeac2ad81f6909213cb81f4e16b1d0762369b53
Signed-off-by: Sergiy Kibrik <sergiy.kibrik@globallogic.com>
Signed-off-by: Lajos Molnar <lajos@ti.com>
Signed-off-by: Dima Svetlov <svetlov@ti.com>
Signed-off-by: Dan Trifan <jimsth@gmail.com>
OMAPDSS: DISPC: more precise scale limits checking

Use division with rounding-up when checking if maximum downscale ratio
was reached. This allows to avoid SYNC_LOST errors in case when small
amount of extra pixels or lines (usually 1-3) not taken into account

Change-Id: Id8f88c64671146a64738cfd820378bb7a28c1455
Signed-off-by: Sergiy Kibrik <sergiy.kibrik@globallogic.com>
Signed-off-by: Dan Trifan <jimsth@gmail.com>
OMAPDSS: DSSCOMP: Fix klocworks errors

Change-Id: If2ed914c738e28c9b5b19b67353bd367d612e91b
Signed-off-by: Tony Lofthouse <a0741364@ti.com>
otg/Makefile: Remove USB debug, dsscomp/device.c: Add DSSCOMP_DEBUG_LOG
dss/core.c: Fix for console debugging at boot
dss/manager.c: Fix for console debugging at boot
OMAP: DSS2: Fix callback completion issue in mgr->blank

Uncommitted callbacks were not completed yet eclipsed in mgr->blank.

Also fixed mgr index in ECLIPSED_CACHE callback.
This patch is co-authored with Muralidhar Dixit <murali.dixit@ti.com>

Change-Id: Ia20b79e9a6308441423d9900469e0c4adfc30eee
Signed-off-by: Lajos Molnar <lajos@ti.com>
Signed-off-by: Muralidhar Dixit <murali.dixit@ti.com>
OMAP4: DSS: Fix to correct the manager index for VSYNC irq handler

Patch to fix the Manager id in dss_completion_irq_handler.
DSSCOMP is expecting the manager id 1 to be mapped to HDMI display.
This patch fixes the DSSCOMP_STATE_DISPLAYED callback in DSSCOMP.

Change-Id: I0aab3e494cb305d75a64fabc4cd6919def636285
Signed-off-by: Muralidhar Dixit <murali.dixit@ti.com>
Signed-off-by: Varadarajan Charulatha <charu@ti.com>
OMAPDSS: DSSCOMP: export needed functions for PVR SGX

OMAPDSS: DSSCOMP: export needed functions for PVR SGX

Make dsscomp symbol visible to kernel modules. The SGX DDK
in modular form requires this symbol to be exported.

Change-Id: I5d45b953379f1ae7c05d10271427a9cd611248a6
Signed-off-by: Rogelio Garcia <rgarcia@ti.com>
OMAPDSS: DSSCOMP: Remove PVR_SGX dependency.

OMAPDSS: DSSCOMP: Remove PVR_SGX dependency.

In order to disable the in-kernel version of the DDK
and be able to use it as a module we need to remove
this dependency.
No harm to DSSCOMP, it will just wait until a DDK
is installed to execute.

Change-Id: Ie1436a45fb20044d0121eb196c6155b50baa7915
Signed-off-by: Rogelio Garcia <rgarcia@ti.com>
overlay.c: warning: suggest parentheses
OMAP:DSS2: Fix FIFO threshold calculation

    Calculated low-threshold value did not seem to work for
    the case of 1 > LineSize/MemoryLineBufferSize > 1/2.  Increased
    calculated value to avoid FIFO THRESHOLD UNDERFLOW errors.

    Change-Id: I60c7fa25de8737ef984bd1506cd70f1d39736acb
    Signed-off-by: Lajos Molnar <molnar@ti.com>

Rebased on latest c-model calculation fixes.

Change-Id: Icf086e71cf70385a0eaf6dbafe8377da92d053ba
Signed-off-by: Girish S G <girishsg@ti.com>
OMAP: DSSCOMP: Use vmalloc for large allocations

Use vmalloc for large allocations that do not need to be
contiguous.  This keeps more memory for kmalloc.

Change-Id: I76290a16498f8846e58559b867013b62bfa3662e
Signed-off-by: Lajos Molnar <lajos@ti.com>
dsscomp/device.c: fix warning defined but not used
Force disable dsscomp debug