aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPraneeth Bajjuri2017-06-02 14:52:15 -0500
committerPraneeth Bajjuri2017-06-02 14:52:15 -0500
commit5a0af72457a9586057d93792d8d74f0318fe04a3 (patch)
tree77a8697666a19dcff513e62820bfead2705a8946
parent1701c344e5dd24ddbeb53a2e303636516028fbd9 (diff)
parent862436d35b0d5d88167c4abb6cf8746f6274f3ce (diff)
downloadkernel-omap-5a0af72457a9586057d93792d8d74f0318fe04a3.tar.gz
kernel-omap-5a0af72457a9586057d93792d8d74f0318fe04a3.tar.xz
kernel-omap-5a0af72457a9586057d93792d8d74f0318fe04a3.zip
Merge tag '6AM.1.3' of git://git.omapzoom.org/kernel/omap into 6AM.1.3-rvc
Android 6AM.1.3 Kernel 4.4.x Release * tag '6AM.1.3' of git://git.omapzoom.org/kernel/omap: omapdrm: Decrement tiler refcount only if pinned Late Attach: Fix for accessing second level page table ARM: DTS: Use reserved mem for late attach IOMMU table ARM: DTS: add LATE ATTACH DTS for DRA7xx Platform OSD Panel dra7xx: lcd: lg: fix pixel clock polarity dra7xx: display: fpdlink: adapt dts to upstream changes Signed-off-by: Praneeth Bajjuri <praneeth@ti.com>
-rw-r--r--arch/arm/boot/dts/dra7-evm-lcd-lg.dts8
-rw-r--r--arch/arm/boot/dts/dra7-evm.dts61
-rw-r--r--arch/arm/boot/dts/dra72-evm-common.dtsi59
-rw-r--r--arch/arm/boot/dts/dra72-evm.dts33
-rw-r--r--arch/arm/boot/dts/dra7x-evm-lcd-lg.dtsi2
-rw-r--r--drivers/gpu/drm/omapdrm/omap_drv.h1
-rw-r--r--drivers/gpu/drm/omapdrm/omap_gem.c21
-rw-r--r--drivers/gpu/drm/omapdrm/omap_gem_dmabuf.c19
8 files changed, 133 insertions, 71 deletions
diff --git a/arch/arm/boot/dts/dra7-evm-lcd-lg.dts b/arch/arm/boot/dts/dra7-evm-lcd-lg.dts
index f67beaa8ff01..2b09d3a8839f 100644
--- a/arch/arm/boot/dts/dra7-evm-lcd-lg.dts
+++ b/arch/arm/boot/dts/dra7-evm-lcd-lg.dts
@@ -14,3 +14,11 @@
14 interrupts = <2 IRQ_TYPE_LEVEL_HIGH>; 14 interrupts = <2 IRQ_TYPE_LEVEL_HIGH>;
15}; 15};
16 16
17
18/* Uncomment the below lines to enable the FPDLink display */
19
20/*
21&lcd_fpd {
22 status = "okay";
23};
24*/
diff --git a/arch/arm/boot/dts/dra7-evm.dts b/arch/arm/boot/dts/dra7-evm.dts
index c2af973a17c2..b1050e3e6c75 100644
--- a/arch/arm/boot/dts/dra7-evm.dts
+++ b/arch/arm/boot/dts/dra7-evm.dts
@@ -987,18 +987,55 @@ i2c_p3_exp: &i2c2 {
987 slave-mode; 987 slave-mode;
988 }; 988 };
989 989
990 /* TLC chip for LCD panel power and backlight */ 990 };
991 fpd_disp: tlc59108@1c { 991};
992 status = "disabled"; 992
993 reg = <0x1c>; 993
994 compatible = "ti,tlc59108-fpddisp"; 994&disp_ser {
995 enable-gpios = <&pcf_gpio_21 0 GPIO_ACTIVE_LOW>; 995 fpd_disp: tlc59108@1c {
996 /* P0, SEL_GPMC_AD_VID_S0 */ 996 #address-cells = <1>;
997 997 #size-cells = <0>;
998 port@lcd3 { 998 compatible = "ti,tlc59108";
999 fpd_in: endpoint { 999 reg = <0x1c>;
1000 remote-endpoint = <&dpi_out3>; 1000
1001 }; 1001 };
1002};
1003
1004/ {
1005 lcd_fpd: display_fpd {
1006 /*
1007 * This is not really a dpi panel, but panel-dpi driver
1008 * works as dummy panel driver.
1009 */
1010 compatible = "lg,lp101wx2", "panel-dpi";
1011
1012 label = "lcd_fpd";
1013 enable-gpios = <&pcf_gpio_21 0 GPIO_ACTIVE_LOW>;
1014 /* P0, SEL_GPMC_AD_VID_S0 */
1015 status = "disabled";
1016
1017 panel-timing {
1018 clock-frequency = <69300404>;
1019 hactive = <1280>;
1020 vactive = <800>;
1021
1022 hfront-porch = <48>;
1023 hback-porch = <44>;
1024 hsync-len = <32>;
1025
1026 vfront-porch = <4>;
1027 vback-porch = <7>;
1028 vsync-len = <12>;
1029
1030 hsync-active = <0>;
1031 vsync-active = <0>;
1032 de-active = <1>;
1033 pixelclk-active = <0>;
1034 };
1035
1036 port@lcd3 {
1037 fpd_in: endpoint {
1038 remote-endpoint = <&dpi_out3>;
1002 }; 1039 };
1003 }; 1040 };
1004 }; 1041 };
diff --git a/arch/arm/boot/dts/dra72-evm-common.dtsi b/arch/arm/boot/dts/dra72-evm-common.dtsi
index dd2b57f1c131..2203e5ad124a 100644
--- a/arch/arm/boot/dts/dra72-evm-common.dtsi
+++ b/arch/arm/boot/dts/dra72-evm-common.dtsi
@@ -600,19 +600,54 @@ i2c_p3_exp: &i2c5 {
600 reg = <0x2c>; 600 reg = <0x2c>;
601 slave-mode; 601 slave-mode;
602 }; 602 };
603 };
604};
603 605
604 /* TLC chip for LCD panel power and backlight */ 606&disp_ser {
605 fpd_disp: tlc59108@1c { 607 fpd_disp: tlc59108@1c {
606 status = "disabled"; 608 #address-cells = <1>;
607 reg = <0x1c>; 609 #size-cells = <0>;
608 compatible = "ti,tlc59108-fpddisp"; 610 compatible = "ti,tlc59108";
609 enable-gpios = <&pcf_gpio_21 0 GPIO_ACTIVE_LOW>; 611 reg = <0x1c>;
610 /* P0, SEL_GPMC_AD_VID_S0 */ 612
611 613 };
612 port@lcd3 { 614};
613 fpd_in: endpoint { 615
614 remote-endpoint = <&dpi_out3>; 616/ {
615 }; 617 lcd_fpd: display_fpd {
618 /*
619 * This is not really a dpi panel, but panel-dpi driver
620 * works as dummy panel driver.
621 */
622 compatible = "lg,lp101wx2", "panel-dpi";
623
624 label = "lcd_fpd";
625 enable-gpios = <&pcf_gpio_21 0 GPIO_ACTIVE_LOW>;
626 /* P0, SEL_GPMC_AD_VID_S0 */
627 status = "disabled";
628
629 panel-timing {
630 clock-frequency = <69300404>;
631 hactive = <1280>;
632 vactive = <800>;
633
634 hfront-porch = <48>;
635 hback-porch = <44>;
636 hsync-len = <32>;
637
638 vfront-porch = <4>;
639 vback-porch = <7>;
640 vsync-len = <12>;
641
642 hsync-active = <0>;
643 vsync-active = <0>;
644 de-active = <1>;
645 pixelclk-active = <0>;
646 };
647
648 port@lcd3 {
649 fpd_in: endpoint {
650 remote-endpoint = <&dpi_out3>;
616 }; 651 };
617 }; 652 };
618 }; 653 };
diff --git a/arch/arm/boot/dts/dra72-evm.dts b/arch/arm/boot/dts/dra72-evm.dts
index deef9b8520b2..73ac6c98771f 100644
--- a/arch/arm/boot/dts/dra72-evm.dts
+++ b/arch/arm/boot/dts/dra72-evm.dts
@@ -215,39 +215,6 @@
215 }; 215 };
216}; 216};
217 217
218&i2c5 {
219 disp_ser: serializer@1b {
220 compatible = "ti,ds90uh925q";
221 reg = <0x1b>;
222
223 #address-cells = <1>;
224 #size-cells = <0>;
225 ranges = <0x2c 0x2c>,
226 <0x1c 0x1c>;
227
228 disp_des: deserializer@2c {
229 compatible = "ti,ds90uh928q";
230 reg = <0x2c>;
231 slave-mode;
232 };
233
234 /* TLC chip for LCD panel power and backlight */
235 fpd_disp: tlc59108@1c {
236 status = "disabled";
237 reg = <0x1c>;
238 compatible = "ti,tlc59108-fpddisp";
239 enable-gpios = <&pcf_gpio_21 0 GPIO_ACTIVE_LOW>;
240 /* P0, SEL_GPMC_AD_VID_S0 */
241
242 port@lcd3 {
243 fpd_in: endpoint {
244 remote-endpoint = <&dpi_out3>;
245 };
246 };
247 };
248 };
249};
250
251&hdmi { 218&hdmi {
252 vdda_video-supply = <&ldo5_reg>; 219 vdda_video-supply = <&ldo5_reg>;
253}; 220};
diff --git a/arch/arm/boot/dts/dra7x-evm-lcd-lg.dtsi b/arch/arm/boot/dts/dra7x-evm-lcd-lg.dtsi
index 97939eef7b94..52a957d08cf2 100644
--- a/arch/arm/boot/dts/dra7x-evm-lcd-lg.dtsi
+++ b/arch/arm/boot/dts/dra7x-evm-lcd-lg.dtsi
@@ -51,7 +51,7 @@
51 hsync-active = <0>; 51 hsync-active = <0>;
52 vsync-active = <0>; 52 vsync-active = <0>;
53 de-active = <1>; 53 de-active = <1>;
54 pixelclk-active = <1>; 54 pixelclk-active = <0>;
55 }; 55 };
56 56
57 port { 57 port {
diff --git a/drivers/gpu/drm/omapdrm/omap_drv.h b/drivers/gpu/drm/omapdrm/omap_drv.h
index 6ebe480e7038..c87c6bca9f28 100644
--- a/drivers/gpu/drm/omapdrm/omap_drv.h
+++ b/drivers/gpu/drm/omapdrm/omap_drv.h
@@ -246,6 +246,7 @@ int omap_gem_get_pages(struct drm_gem_object *obj, struct page ***pages,
246 bool remap); 246 bool remap);
247int omap_gem_put_pages(struct drm_gem_object *obj); 247int omap_gem_put_pages(struct drm_gem_object *obj);
248struct sg_table *omap_gem_get_sgt(struct drm_gem_object *obj); 248struct sg_table *omap_gem_get_sgt(struct drm_gem_object *obj);
249void omap_gem_put_sgt(struct drm_gem_object *obj, struct sg_table *sg);
249uint32_t omap_gem_flags(struct drm_gem_object *obj); 250uint32_t omap_gem_flags(struct drm_gem_object *obj);
250int omap_gem_rotated_paddr(struct drm_gem_object *obj, uint32_t orient, 251int omap_gem_rotated_paddr(struct drm_gem_object *obj, uint32_t orient,
251 int x, int y, dma_addr_t *paddr); 252 int x, int y, dma_addr_t *paddr);
diff --git a/drivers/gpu/drm/omapdrm/omap_gem.c b/drivers/gpu/drm/omapdrm/omap_gem.c
index 122f856bb041..3e805836e069 100644
--- a/drivers/gpu/drm/omapdrm/omap_gem.c
+++ b/drivers/gpu/drm/omapdrm/omap_gem.c
@@ -811,7 +811,14 @@ struct sg_table *omap_gem_get_sgt(struct drm_gem_object *obj)
811{ 811{
812 struct omap_gem_object *omap_obj = to_omap_bo(obj); 812 struct omap_gem_object *omap_obj = to_omap_bo(obj);
813 struct sg_table *sg; 813 struct sg_table *sg;
814 int npages = obj->size >> PAGE_SHIFT; 814 dma_addr_t paddr;
815 int ret;
816 bool remap;
817
818 remap = omap_obj->flags & OMAP_BO_SCANOUT;
819 ret = omap_gem_get_paddr(obj, &paddr, remap);
820 if (ret)
821 goto out;
815 822
816 sg = kmalloc(sizeof(*sg), GFP_KERNEL); 823 sg = kmalloc(sizeof(*sg), GFP_KERNEL);
817 if (!sg) 824 if (!sg)
@@ -829,6 +836,7 @@ struct sg_table *omap_gem_get_sgt(struct drm_gem_object *obj)
829 } else if (omap_obj->pages) { 836 } else if (omap_obj->pages) {
830 struct scatterlist *sgl; 837 struct scatterlist *sgl;
831 unsigned int i = 0; 838 unsigned int i = 0;
839 int npages = obj->size >> PAGE_SHIFT;
832 840
833 if (sg_alloc_table(sg, npages, GFP_KERNEL)) 841 if (sg_alloc_table(sg, npages, GFP_KERNEL))
834 goto free; 842 goto free;
@@ -844,12 +852,23 @@ struct sg_table *omap_gem_get_sgt(struct drm_gem_object *obj)
844 } 852 }
845 return sg; 853 return sg;
846 854
855out:
856 return ERR_PTR(ret);
847free: 857free:
848 sg_free_table(sg); 858 sg_free_table(sg);
849 kfree(sg); 859 kfree(sg);
850 return NULL; 860 return NULL;
851} 861}
852 862
863void omap_gem_put_sgt(struct drm_gem_object *obj, struct sg_table *sg)
864{
865 struct omap_gem_object *omap_obj = to_omap_bo(obj);
866 bool remap = omap_obj->flags & OMAP_BO_SCANOUT;
867
868 if (remap)
869 omap_gem_put_paddr(obj);
870}
871
853/* Get physical address for DMA.. if 'remap' is true, and the buffer is not 872/* Get physical address for DMA.. if 'remap' is true, and the buffer is not
854 * already contiguous, remap it to pin in physically contiguous memory.. (ie. 873 * already contiguous, remap it to pin in physically contiguous memory.. (ie.
855 * map in TILER) 874 * map in TILER)
diff --git a/drivers/gpu/drm/omapdrm/omap_gem_dmabuf.c b/drivers/gpu/drm/omapdrm/omap_gem_dmabuf.c
index f53bbc50e382..f418a7d07205 100644
--- a/drivers/gpu/drm/omapdrm/omap_gem_dmabuf.c
+++ b/drivers/gpu/drm/omapdrm/omap_gem_dmabuf.c
@@ -30,29 +30,24 @@ static struct sg_table *omap_gem_map_dma_buf(
30 enum dma_data_direction dir) 30 enum dma_data_direction dir)
31{ 31{
32 struct drm_gem_object *obj = attachment->dmabuf->priv; 32 struct drm_gem_object *obj = attachment->dmabuf->priv;
33 dma_addr_t paddr; 33 struct sg_table *sg;
34 int ret;
35 34
36 /* camera, etc, need physically contiguous.. but we need a 35 sg = omap_gem_get_sgt(obj);
37 * better way to know this.. 36 if (IS_ERR(sg))
38 */ 37 return sg;
39 ret = omap_gem_get_paddr(obj, &paddr, false);
40 if (ret)
41 goto out;
42 38
43 /* this should be after _get_paddr() to ensure we have pages attached */ 39 /* this should be after _get_paddr() to ensure we have pages attached */
44 omap_gem_dma_sync(obj, dir); 40 omap_gem_dma_sync(obj, dir);
45 41
46 return omap_gem_get_sgt(obj); 42 return sg;
47out:
48 return ERR_PTR(ret);
49} 43}
50 44
51static void omap_gem_unmap_dma_buf(struct dma_buf_attachment *attachment, 45static void omap_gem_unmap_dma_buf(struct dma_buf_attachment *attachment,
52 struct sg_table *sg, enum dma_data_direction dir) 46 struct sg_table *sg, enum dma_data_direction dir)
53{ 47{
54 struct drm_gem_object *obj = attachment->dmabuf->priv; 48 struct drm_gem_object *obj = attachment->dmabuf->priv;
55 omap_gem_put_paddr(obj); 49
50 omap_gem_put_sgt(obj, sg);
56 sg_free_table(sg); 51 sg_free_table(sg);
57 kfree(sg); 52 kfree(sg);
58} 53}