Commit graph

23 commits

Author SHA1 Message Date
Adrian Salido-Moreno
c5180403ed msm: mdss: fix suspend coming to MDP before panel drivers
If suspend event is received by MDP before panels, MDP needs to ensure
other panels are off before turning MDP clocks off. Remove handlers from
framebuffer driver and handle all suspend logic within MDP driver to
handle this scenario.

Change-Id: Idcda2dd29b28a9993edca78b7e0778985e44b664
Signed-off-by: Adrian Salido-Moreno <adrianm@codeaurora.org>
2013-02-27 18:21:27 -08:00
Adrian Salido-Moreno
b6d7c6c8f9 msm: mdss: improve clock and bus scaling logic
Current clock logic only considers panel pixel clock to calculate mdp
clock speed, MDP clock speed should also consider other factors such
as surface scaling. Bus scaling should also consider surface scaling
factor. Update logic to consider these new factors and perform these
performance updates together.

Change-Id: If274a7f40f496e1a730e1d0e8d7c35fa4384a832
Signed-off-by: Adrian Salido-Moreno <adrianm@codeaurora.org>
2013-02-27 18:21:27 -08:00
Adrian Salido-Moreno
659be67242 msm: mdss: allocate framebuffer memory from ion pool
When panel size is increased dma_alloc_coherent is not able to find
a chunk of contiguous memory big enough to hold framebuffer, this causes
framebuffer initialization to fail. Allocate buffer from ion pool which
has reserved contiguous memory at earlier stage.

Change-Id: Ibf7e3f7fc2c7ad991d69c106bbb6a9dd4c7f0e79
Signed-off-by: Adrian Salido-Moreno <adrianm@codeaurora.org>
2013-02-27 18:21:25 -08:00
Adrian Salido-Moreno
c6f7e9ceed msm: mdss: fix incorrect programming of timing generator setting
Fix typo in code which is causing incorrect setting of vertical front
porch on timing generator settings and incorrect output to panel.

Change-Id: I4de61209443fcb284b7d4064a2039b5f546935d1
Signed-off-by: Adrian Salido-Moreno <adrianm@codeaurora.org>
2013-02-27 18:21:05 -08:00
Chandan Uddaraju
c350849461 msm_fb: MDSS: Add DSI driver support for MDSS
Add the dsi driver implementation for
DSI version 3.0. Use the panel information
retrieved from the 'dts' to configure the
interface parameters.

Add the device tree binding file to specify the
basic configuration and panel features.

Change-Id: I6a3677401454ad1d2bc29b0b845b0366eb7842b7
Signed-off-by: Chandan Uddaraju <chandanu@codeaurora.org>
2013-02-27 18:19:10 -08:00
Deva Ramasubramanian
5fed32c16c msm: mdss: Use YCrCb 420 as the output format for writeback
Use YCrCb 420 (NV12) as the output format for writeback.  For Wifi Display
use case, NV12 is required as the encoder requires this as the output
format.

Change-Id: Ica8851073476b9c05f3b5b41232803c2d71f7a3e
Signed-off-by: Deva Ramasubramanian <dramasub@codeaurora.org>
2013-02-27 18:18:26 -08:00
Deva Ramasubramanian
b59d111e75 msm: mdss: Return proper msmfb_data back to client
For local clients, return the relevant msmfb_data which contains a
cookie relevant to the client.

Change-Id: I9b845c0cd7fde1bc8c53a5063ba331460d67427d
Signed-off-by: Deva Ramasubramanian <dramasub@codeaurora.org>
2013-02-27 18:18:25 -08:00
Adrian Salido-Moreno
8324566fb0 mdss: display: expose panel parameters through framebuffer API
Panel porch values and pixel clock can be used to calculate the refresh
rate from user space. Assign these values with information from panel
driver.

Change-Id: I29995d27904e50892d72de5e8c7dd39285f9d421
Signed-off-by: Adrian Salido-Moreno <adrianm@codeaurora.org>
2013-02-27 18:18:07 -08:00
Adrian Salido-Moreno
6252708c00 mdss: display: allocate buffer from ion when debug writeback enabled
Debug writeback is used to output MDSS framebuffer contents to memory to
for debugging of MDSS core. Use ion buffer allocation for debug
writeback buffer instead of using memory from framebuffer base layer to
allow entire framebuffer area to be used for composition.

Change-Id: Ia1a91f5f14bed1d29691092142fc94f7a8b6f4d2
Signed-off-by: Adrian Salido-Moreno <adrianm@codeaurora.org>
2013-02-27 18:18:05 -08:00
Adrian Salido-Moreno
a1eb2beb6e mdss: display: fix incorrect rotator programming
Source format should indicate that source is to be rotated 90 degrees
instead of indicating source has been rotated 90 degrees. This is needed
for hardware to fetch source in correct order and generate correct 90
degree output image.

Change-Id: If8d1e12ef3e7a291e67ec9763f5ca92ec6fa983c
Signed-off-by: Adrian Salido-Moreno <adrianm@codeaurora.org>
2013-02-27 18:18:04 -08:00
Adrian Salido-Moreno
6a12cf3410 mdss: display: remove check for odd dst offsets
MDSS does not support odd width, height or src offsets for YUV formats,
however odd coordinates are acceptable for dst offsets. Remove odd check
done for dst offsets

CRs-Fixed: 372900
Change-Id: I69230640f94bf080a8be4ea6d79f0901a7fa72cd
Signed-off-by: Adrian Salido-Moreno <adrianm@codeaurora.org>
2013-02-27 18:18:04 -08:00
Laura Abbott
bc478d4c60 gpu: ion: Pull in patches for 3.4
Pull in Ion patches for 3.4 upgrade. Inclues the following
patches from google:

 commit 7191e9ba25
 Author: Rebecca Schultz Zavin <rebecca@android.com>
 Date:   Mon Jan 30 14:18:08 2012 -0800

     ion: Switch map/unmap dma api to sg_tables

     Switch these api's from scatterlists to sg_tables

     Signed-off-by: Rebecca Schultz Zavin <rebecca@android.com>

 commit 6f9e56945d
 Author: Rebecca Schultz Zavin <rebecca@android.com>
 Date:   Tue Jan 31 09:40:30 2012 -0800

     ion: Add reserve function to ion

     Rather than requiring each platform call memblock_remove or reserve
     from the board file, add this to ion

     Signed-off-by: Rebecca Schultz Zavin <rebecca@android.com>

 commit 9ae7e01de1
 Author: KyongHo Cho <pullip.cho@samsung.com>
 Date:   Wed Sep 7 11:27:07 2011 +0900

     gpu: ion: several bugfixes and enhancements of ION

     1. Verifying if the size of memory allocation in ion_alloc() is aligned
     by PAGE_SIZE at least. If it is not, this change makes the size to be
     aligned by PAGE_SIZE.

     2. Unmaps all mappings to the kernel and DMA address spaces when
     destroying ion_buffer in ion_buffer_destroy(). This prevents leaks in
     those virtual address spaces.

     3. Makes the return value of ion_alloc() to be explicit Linux error code
     when it fails to allocate a buffer.

     4. Makes ion_alloc() implementation simpler. Removes 'goto' statement and
     relavant call to ion_buffer_put().

     5. Checks if the task is valid before calling put_task_struct() due
     to failure on creating a ion client in ion_client_create().

     6. Returns error when buffer allocation requested by userspace is failed.

     Signed-off-by: KyongHo Cho <pullip.cho@samsung.com>

 commit 043a61468f
 Author: Rebecca Schultz Zavin <rebecca@android.com>
 Date:   Wed Feb 1 11:09:46 2012 -0800

     ion: Switch ion to use dma-buf

     Ion now uses dma-buf file descriptors to share
     buffers with userspace.  Ion becomes a dma-buf
     exporter and any driver that can import dma-bufs
     can now import ion file descriptors.

     Signed-off-by: Rebecca Schultz Zavin <rebecca@android.com>

 commit 0d1259b5f8
 Author: Rebecca Schultz Zavin <rebecca@android.com>
 Date:   Mon Apr 30 16:45:38 2012 -0700

     gpu: ion: Use alloc_pages instead of vmalloc from the system heap

     With this change the ion_system_heap will only use kernel address
     space when the memory is mapped into the kernel (rare case).

     Signed-off-by: Rebecca Schultz Zavin <rebecca@android.com>

 commit be4a1ee79a
 Author: Rebecca Schultz Zavin <rebecca@android.com>
 Date:   Thu Apr 26 20:44:10 2012 -0700

     gpu: ion: support begin/end and kmap/kunmap dma_buf ops

     These ops were added in the 3.4 kernel.  This patch adds support
     for them to ion.  Previous ion_map/unmap_kernel api is also
     retained in addition to this new api.

     Signed-off-by: Rebecca Schultz Zavin <rebecca@android.com>

 commit 46d71337f9
 Author: Rebecca Schultz Zavin <rebecca@android.com>
 Date:   Mon May 7 16:06:32 2012 -0700

     gpu: ion: Allocate the sg_table at creation time rather than dynamically

     Rather than calling map_dma on the allocations dynamically, this patch
     switches to creating the sg_table at the time the buffer is created.
     This is necessary because in future updates the sg_table will be used
     for cache maintenance.

     Signed-off-by: Rebecca Schultz Zavin <rebecca@android.com>

 commit 903f6c716d
 Author: Rebecca Schultz Zavin <rebecca@android.com>
 Date:   Wed May 23 12:55:55 2012 -0700

     gpu: ion: Get an sg_table from an ion handle

     This patch adds an interface to return and sg_table given a
     valid ion handle.

     Signed-off-by: Rebecca Schultz Zavin <rebecca@android.com>

The commit also includes fixups needed for MSM specific code.

Change-Id: Idbcfa9d6af0febf06f56daaa6beaa59cc08e4351
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
2013-02-27 18:14:28 -08:00
Matt Wagantall
311882694b mdss: display: Correct regulator API usage
A device pointer should be passed to regulator_get() as the first
argument, and the regulator mapped to the MDSS device in the device
tree. Do this.

This also resolves the following message seen in debugfs, which
is present when regulator_get() is called with a NULL device:
<4>[ 1.145507] gdsc_mdss: Failed to create debugfs directory

Change-Id: I70a5137a31dbf82ae1e6634249f274cb16fe7a71
Signed-off-by: Matt Wagantall <mattw@codeaurora.org>
2013-02-27 18:13:35 -08:00
Adrian Salido-Moreno
627620e84f mdss: display: Add writeback support for WFD
- Implement APIs used to support wifi display (WFD) based on ioctls and
  functions declared in linux/msm_mdp.h.
- Restructure writeback interface file to support custom output formats
  and take buffers from WFD APIs.

Change-Id: I3e6b75bd8b7d73eb20c97899de1891bbd85e9fa4
Signed-off-by: Adrian Salido-Moreno <adrianm@codeaurora.org>
2013-02-27 18:13:19 -08:00
Adrian Salido-Moreno
d673e17729 mdss: display: implement common irq handler for different mdss blocks
All of MDSS blocks (mdp, dsi, edp, hdmi) share same irq line. Implement
function to manage MDSS irq line with common API with support for irq
callback handler for each of block. Also fix incorrect calculation of
MDP interface interrupts.

Change-Id: I1271f7e1065aac95175b6e92504917264f4043a5
Signed-off-by: Adrian Salido-Moreno <adrianm@codeaurora.org>
2013-02-27 18:12:43 -08:00
Adrian Salido-Moreno
0b73752fe7 mdss: display: add video display interface support
Video mode display interface is used by DSI, HDMI and EDP controllers.
Implement MDP support in order to setup data path to these controllers.

Change-Id: Ibc766a1d10a55bcf64a3ab693db034a378afe4ee
Signed-off-by: Adrian Salido-Moreno <adrianm@codeaurora.org>
2013-02-27 18:12:42 -08:00
Adrian Salido-Moreno
44910c9771 mdss: display: implement csc matrix programming
Implement color conversion matrix programming to support YUV surfaces.
Also add dspp initialization stub function.

Change-Id: I7ba57eca24e15acffbddf7b81fac6b8a6ce3bba5
Signed-off-by: Adrian Salido-Moreno <adrianm@codeaurora.org>
2013-02-27 18:12:42 -08:00
Adrian Salido-Moreno
edfe39d325 mdss: display: add rotator interface to mdss driver
Add rotator session management support with overlay interface using MDP
flag MDSS_MDP_ROT_ONLY. Overlay interface can only support overlay
surface or rotator (written back to memory) but not both.

Change-Id: Ib2f494683b2e6c2fd8c67818df2b57afb82a3df3
Signed-off-by: Adrian Salido-Moreno <adrianm@codeaurora.org>
2013-02-27 18:12:41 -08:00
Adrian Salido-Moreno
1cda65e65f mdss: display: add clock and bus scaling logic
MDSS hardware supports different bus bandwidth and clock frequencies
depending on the load on the hardware. Add support to driver to
calculate the bus bandwidth and clock frequency requirements and
activate changes before the load on hardware changes.

Change-Id: I9bb5bbc7b3e18fb1a738f527b875506dfa0c5c81
Signed-off-by: Adrian Salido-Moreno <adrianm@codeaurora.org>
2013-02-27 18:12:40 -08:00
Adrian Salido-Moreno
a49e0236fb msm: copper: add device nodes and clock information for mdss
Copper uses Mobile Display SubSystem, add device tree and clock
information to be used in mdss driver.

Change-Id: I67397a28168407b3268f4f026f35d69a04062995
Signed-off-by: Nagamalleswararao Ganji <nganji@codeaurora.org>
Signed-off-by: Adrian Salido-Moreno <adrianm@codeaurora.org>
2013-02-27 18:12:40 -08:00
Adrian Salido-Moreno
02d2604cc5 mdss: display: add overlay ioctl apis to mdss driver
- Add support for overlay IOCTL APIs defined in linux/msm_mdp.h
- Support for ion client buffers and framebuffer memory

Change-Id: I0418ecab9aacf826d900f82f179fa20688fc763e
Signed-off-by: Adrian Salido-Moreno <adrianm@codeaurora.org>
2013-02-27 18:11:37 -08:00
Adrian Salido-Moreno
40c4d9f2d3 mdss: display: implement writeback interface for mdss
Add writeback interface support, using one page of framebuffer memory
for writeback output.

Change-Id: I0a44c6907cbc10d97c78642f45dc018dfb2d1750
Signed-off-by: Adrian Salido-Moreno <adrianm@codeaurora.org>
2013-02-27 18:11:36 -08:00
Adrian Salido-Moreno
145cc2b53c mdss: display: Add Mobile Display SubSystem driver
- Implements Linux frame buffer interface to interact with userspace
  libraries and applications, based on msm_fb frame buffer.
- Implement MDP driver which handles MDP core data path setup and
  hardware blocks programming.
- Support for UI through Linux frame buffer FBIOPAN_DISPLAY ioctl.

Change-Id: Ib98677b8d81d74283b27dea08a9f1a705c101bce
Signed-off-by: Adrian Salido-Moreno <adrianm@codeaurora.org>
2013-02-27 18:11:36 -08:00