aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2014-12-15 21:06:13 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2014-12-15 21:06:13 -0500
commitdab363f938a53ddaee60bfecc1aebdbb3d3af5f0 (patch)
treeccdb11a6e6191ba71fbc7716714c47b79172070d /drivers/gpu
parenta68db9cb858d10820add66682ad4d412f9914288 (diff)
parent17d2c6439be65777245914be354c5a97c76ad246 (diff)
Merge tag 'staging-3.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging
Pull staging driver updates from Greg KH: "Here's the big staging tree pull request for 3.19-rc1. We continued to delete more lines than were added, always a good thing, but not at a huge rate this release, only about 70k lines removed overall mostly from removing the horrid bcm driver. Lots of normal staging driver cleanups and fixes all over the place, well over a thousand of them, the shortlog shows all the horrid details. The "contentious" thing here is the movement of the Android binder code out of staging into the "real" part of the kernel. This is code that has been stable for a few years now and is working as-is in the tens of millions of devices with no issues. Yes, the code is horrid, and the userspace api leaves a lot to be desired, but it's not going to change due to legacy issues that we have no control over. Because so many devices and companies rely on this, and the code is stable, might as well promote it out of staging. This was all discussed at the Linux Plumbers conference, and everyone participating agreed that this was the best way forward. There is work happening to replace the binder code with something new that is happening right now, but I don't expect to see the results of that work for another year at the earliest. If that ever happens, and Android switches over to it, I'll gladly remove this version. As for maintainers, I'll be glad to maintain this code, I've been doing it for the past few years with no problems. I'll send a MAINTAINERS entry for it before 3.19-final is out, still need to talk to the Google developers about if they are willing to help with it or not, last I checked they were, which was good. All of these patches have been in linux-next for a while with no reported issues" * tag 'staging-3.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging: (1382 commits) Staging: slicoss: Fix long line issues in slicoss.c staging: rtl8712: remove unnecessary else after return staging: comedi: change some printk calls to pr_err staging: rtl8723au: hal: Removed the extra semicolon lustre: Deletion of unnecessary checks before three function calls staging: lustre: fix sparse warnings: static function declaration staging: lustre: fixed sparse warnings related to static declarations staging: unisys: remove duplicate header staging: unisys: remove unneeded structure staging: ft1000 : replace __attribute ((__packed__) with __packed drivers: staging: rtl8192e: Include "asm/unaligned.h" instead of "access_ok.h" in "rtl819x_BAProc.c" Drivers:staging:rtl8192e: Fixed checkpatch warning Drivers:staging:clocking-wizard: Added a newline staging: clocking-wizard: check for a valid clk_name pointer staging: rtl8723au: Hal_InitPGData() avoid unnecessary typecasts staging: rtl8723au: _DisableAnalog(): Avoid zero-init variables unnecessarily staging: rtl8723au: Remove unnecessary wrapper _ResetDigitalProcedure1() staging: rtl8723au: _ResetDigitalProcedure1_92C() reduce code obfuscation staging: rtl8723au: Remove unnecessary wrapper _DisableRFAFEAndResetBB() staging: rtl8723au: _DisableRFAFEAndResetBB8192C(): Reduce code obfuscation ...
Diffstat (limited to 'drivers/gpu')
-rw-r--r--drivers/gpu/drm/imx/Kconfig7
-rw-r--r--drivers/gpu/drm/imx/imx-drm-core.c5
-rw-r--r--drivers/gpu/drm/imx/imx-ldb.c5
-rw-r--r--drivers/gpu/drm/imx/imx-tve.c8
-rw-r--r--drivers/gpu/drm/imx/ipuv3-crtc.c5
-rw-r--r--drivers/gpu/drm/imx/ipuv3-plane.c43
-rw-r--r--drivers/gpu/drm/imx/ipuv3-plane.h2
-rw-r--r--drivers/gpu/drm/imx/parallel-display.c13
8 files changed, 55 insertions, 33 deletions
diff --git a/drivers/gpu/drm/imx/Kconfig b/drivers/gpu/drm/imx/Kconfig
index 82fb758a29bc..ab31848e92cf 100644
--- a/drivers/gpu/drm/imx/Kconfig
+++ b/drivers/gpu/drm/imx/Kconfig
@@ -6,6 +6,7 @@ config DRM_IMX
6 select DRM_GEM_CMA_HELPER 6 select DRM_GEM_CMA_HELPER
7 select DRM_KMS_CMA_HELPER 7 select DRM_KMS_CMA_HELPER
8 depends on DRM && (ARCH_MXC || ARCH_MULTIPLATFORM) 8 depends on DRM && (ARCH_MXC || ARCH_MULTIPLATFORM)
9 depends on IMX_IPUV3_CORE
9 help 10 help
10 enable i.MX graphics support 11 enable i.MX graphics support
11 12
@@ -40,11 +41,11 @@ config DRM_IMX_LDB
40 found on i.MX53 and i.MX6 processors. 41 found on i.MX53 and i.MX6 processors.
41 42
42config DRM_IMX_IPUV3 43config DRM_IMX_IPUV3
43 tristate "DRM Support for i.MX IPUv3" 44 tristate
44 depends on DRM_IMX 45 depends on DRM_IMX
45 depends on IMX_IPUV3_CORE 46 depends on IMX_IPUV3_CORE
46 help 47 default y if DRM_IMX=y
47 Choose this if you have a i.MX5 or i.MX6 processor. 48 default m if DRM_IMX=m
48 49
49config DRM_IMX_HDMI 50config DRM_IMX_HDMI
50 tristate "Freescale i.MX DRM HDMI" 51 tristate "Freescale i.MX DRM HDMI"
diff --git a/drivers/gpu/drm/imx/imx-drm-core.c b/drivers/gpu/drm/imx/imx-drm-core.c
index e48b2211d2d6..b250130debc8 100644
--- a/drivers/gpu/drm/imx/imx-drm-core.c
+++ b/drivers/gpu/drm/imx/imx-drm-core.c
@@ -30,8 +30,6 @@
30 30
31#define MAX_CRTC 4 31#define MAX_CRTC 4
32 32
33struct imx_drm_crtc;
34
35struct imx_drm_component { 33struct imx_drm_component {
36 struct device_node *of_node; 34 struct device_node *of_node;
37 struct list_head list; 35 struct list_head list;
@@ -633,7 +631,8 @@ static int imx_drm_platform_probe(struct platform_device *pdev)
633 continue; 631 continue;
634 } 632 }
635 633
636 component_match_add(&pdev->dev, &match, compare_of, remote); 634 component_match_add(&pdev->dev, &match, compare_of,
635 remote);
637 of_node_put(remote); 636 of_node_put(remote);
638 } 637 }
639 of_node_put(port); 638 of_node_put(port);
diff --git a/drivers/gpu/drm/imx/imx-ldb.c b/drivers/gpu/drm/imx/imx-ldb.c
index 2638dc1671d0..c60460043e24 100644
--- a/drivers/gpu/drm/imx/imx-ldb.c
+++ b/drivers/gpu/drm/imx/imx-ldb.c
@@ -11,11 +11,6 @@
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details. 13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
18 * MA 02110-1301, USA.
19 */ 14 */
20 15
21#include <linux/module.h> 16#include <linux/module.h>
diff --git a/drivers/gpu/drm/imx/imx-tve.c b/drivers/gpu/drm/imx/imx-tve.c
index 64b54d7f996c..a729f4f7074c 100644
--- a/drivers/gpu/drm/imx/imx-tve.c
+++ b/drivers/gpu/drm/imx/imx-tve.c
@@ -11,11 +11,6 @@
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details. 13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
18 * MA 02110-1301, USA.
19 */ 14 */
20 15
21#include <linux/clk.h> 16#include <linux/clk.h>
@@ -665,7 +660,8 @@ static int imx_tve_bind(struct device *dev, struct device *master, void *data)
665 660
666 ret = regmap_read(tve->regmap, TVE_COM_CONF_REG, &val); 661 ret = regmap_read(tve->regmap, TVE_COM_CONF_REG, &val);
667 if (ret < 0) { 662 if (ret < 0) {
668 dev_err(dev, "failed to read configuration register: %d\n", ret); 663 dev_err(dev, "failed to read configuration register: %d\n",
664 ret);
669 return ret; 665 return ret;
670 } 666 }
671 if (val != 0x00100000) { 667 if (val != 0x00100000) {
diff --git a/drivers/gpu/drm/imx/ipuv3-crtc.c b/drivers/gpu/drm/imx/ipuv3-crtc.c
index 11e84a251773..ebee59cb96d8 100644
--- a/drivers/gpu/drm/imx/ipuv3-crtc.c
+++ b/drivers/gpu/drm/imx/ipuv3-crtc.c
@@ -11,11 +11,6 @@
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details. 13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
18 * MA 02110-1301, USA.
19 */ 14 */
20#include <linux/component.h> 15#include <linux/component.h>
21#include <linux/module.h> 16#include <linux/module.h>
diff --git a/drivers/gpu/drm/imx/ipuv3-plane.c b/drivers/gpu/drm/imx/ipuv3-plane.c
index 944962b692bb..6987e16fe99b 100644
--- a/drivers/gpu/drm/imx/ipuv3-plane.c
+++ b/drivers/gpu/drm/imx/ipuv3-plane.c
@@ -64,6 +64,7 @@ int ipu_plane_set_base(struct ipu_plane *ipu_plane, struct drm_framebuffer *fb,
64{ 64{
65 struct drm_gem_cma_object *cma_obj; 65 struct drm_gem_cma_object *cma_obj;
66 unsigned long eba; 66 unsigned long eba;
67 int active;
67 68
68 cma_obj = drm_fb_cma_get_gem_obj(fb, 0); 69 cma_obj = drm_fb_cma_get_gem_obj(fb, 0);
69 if (!cma_obj) { 70 if (!cma_obj) {
@@ -74,12 +75,17 @@ int ipu_plane_set_base(struct ipu_plane *ipu_plane, struct drm_framebuffer *fb,
74 dev_dbg(ipu_plane->base.dev->dev, "phys = %pad, x = %d, y = %d", 75 dev_dbg(ipu_plane->base.dev->dev, "phys = %pad, x = %d, y = %d",
75 &cma_obj->paddr, x, y); 76 &cma_obj->paddr, x, y);
76 77
77 ipu_cpmem_set_stride(ipu_plane->ipu_ch, fb->pitches[0]);
78
79 eba = cma_obj->paddr + fb->offsets[0] + 78 eba = cma_obj->paddr + fb->offsets[0] +
80 fb->pitches[0] * y + (fb->bits_per_pixel >> 3) * x; 79 fb->pitches[0] * y + (fb->bits_per_pixel >> 3) * x;
81 ipu_cpmem_set_buffer(ipu_plane->ipu_ch, 0, eba); 80
82 ipu_cpmem_set_buffer(ipu_plane->ipu_ch, 1, eba); 81 if (ipu_plane->enabled) {
82 active = ipu_idmac_get_current_buffer(ipu_plane->ipu_ch);
83 ipu_cpmem_set_buffer(ipu_plane->ipu_ch, !active, eba);
84 ipu_idmac_select_buffer(ipu_plane->ipu_ch, !active);
85 } else {
86 ipu_cpmem_set_buffer(ipu_plane->ipu_ch, 0, eba);
87 ipu_cpmem_set_buffer(ipu_plane->ipu_ch, 1, eba);
88 }
83 89
84 /* cache offsets for subsequent pageflips */ 90 /* cache offsets for subsequent pageflips */
85 ipu_plane->x = x; 91 ipu_plane->x = x;
@@ -137,6 +143,18 @@ int ipu_plane_mode_set(struct ipu_plane *ipu_plane, struct drm_crtc *crtc,
137 if (crtc_h < 2) 143 if (crtc_h < 2)
138 return -EINVAL; 144 return -EINVAL;
139 145
146 /*
147 * since we cannot touch active IDMAC channels, we do not support
148 * resizing the enabled plane or changing its format
149 */
150 if (ipu_plane->enabled) {
151 if (src_w != ipu_plane->w || src_h != ipu_plane->h ||
152 fb->pixel_format != ipu_plane->base.fb->pixel_format)
153 return -EINVAL;
154
155 return ipu_plane_set_base(ipu_plane, fb, src_x, src_y);
156 }
157
140 switch (ipu_plane->dp_flow) { 158 switch (ipu_plane->dp_flow) {
141 case IPU_DP_FLOW_SYNC_BG: 159 case IPU_DP_FLOW_SYNC_BG:
142 ret = ipu_dp_setup_channel(ipu_plane->dp, 160 ret = ipu_dp_setup_channel(ipu_plane->dp,
@@ -148,14 +166,22 @@ int ipu_plane_mode_set(struct ipu_plane *ipu_plane, struct drm_crtc *crtc,
148 ret); 166 ret);
149 return ret; 167 return ret;
150 } 168 }
151 ipu_dp_set_global_alpha(ipu_plane->dp, 1, 0, 1); 169 ipu_dp_set_global_alpha(ipu_plane->dp, true, 0, true);
152 break; 170 break;
153 case IPU_DP_FLOW_SYNC_FG: 171 case IPU_DP_FLOW_SYNC_FG:
154 ipu_dp_setup_channel(ipu_plane->dp, 172 ipu_dp_setup_channel(ipu_plane->dp,
155 ipu_drm_fourcc_to_colorspace(fb->pixel_format), 173 ipu_drm_fourcc_to_colorspace(fb->pixel_format),
156 IPUV3_COLORSPACE_UNKNOWN); 174 IPUV3_COLORSPACE_UNKNOWN);
157 ipu_dp_set_window_pos(ipu_plane->dp, crtc_x, crtc_y); 175 ipu_dp_set_window_pos(ipu_plane->dp, crtc_x, crtc_y);
158 break; 176 /* Enable local alpha on partial plane */
177 switch (fb->pixel_format) {
178 case DRM_FORMAT_ARGB8888:
179 case DRM_FORMAT_ABGR8888:
180 ipu_dp_set_global_alpha(ipu_plane->dp, false, 0, false);
181 break;
182 default:
183 break;
184 }
159 } 185 }
160 186
161 ret = ipu_dmfc_init_channel(ipu_plane->dmfc, crtc_w); 187 ret = ipu_dmfc_init_channel(ipu_plane->dmfc, crtc_w);
@@ -181,11 +207,16 @@ int ipu_plane_mode_set(struct ipu_plane *ipu_plane, struct drm_crtc *crtc,
181 return ret; 207 return ret;
182 } 208 }
183 ipu_cpmem_set_high_priority(ipu_plane->ipu_ch); 209 ipu_cpmem_set_high_priority(ipu_plane->ipu_ch);
210 ipu_idmac_set_double_buffer(ipu_plane->ipu_ch, 1);
211 ipu_cpmem_set_stride(ipu_plane->ipu_ch, fb->pitches[0]);
184 212
185 ret = ipu_plane_set_base(ipu_plane, fb, src_x, src_y); 213 ret = ipu_plane_set_base(ipu_plane, fb, src_x, src_y);
186 if (ret < 0) 214 if (ret < 0)
187 return ret; 215 return ret;
188 216
217 ipu_plane->w = src_w;
218 ipu_plane->h = src_h;
219
189 return 0; 220 return 0;
190} 221}
191 222
diff --git a/drivers/gpu/drm/imx/ipuv3-plane.h b/drivers/gpu/drm/imx/ipuv3-plane.h
index c0aae5bcb5d4..af125fb40ef5 100644
--- a/drivers/gpu/drm/imx/ipuv3-plane.h
+++ b/drivers/gpu/drm/imx/ipuv3-plane.h
@@ -26,6 +26,8 @@ struct ipu_plane {
26 26
27 int x; 27 int x;
28 int y; 28 int y;
29 int w;
30 int h;
29 31
30 bool enabled; 32 bool enabled;
31}; 33};
diff --git a/drivers/gpu/drm/imx/parallel-display.c b/drivers/gpu/drm/imx/parallel-display.c
index 8a76a5c1c34b..796c3c1c170a 100644
--- a/drivers/gpu/drm/imx/parallel-display.c
+++ b/drivers/gpu/drm/imx/parallel-display.c
@@ -11,11 +11,6 @@
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details. 13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
18 * MA 02110-1301, USA.
19 */ 14 */
20 15
21#include <linux/component.h> 16#include <linux/component.h>
@@ -128,6 +123,10 @@ static void imx_pd_encoder_prepare(struct drm_encoder *encoder)
128 123
129static void imx_pd_encoder_commit(struct drm_encoder *encoder) 124static void imx_pd_encoder_commit(struct drm_encoder *encoder)
130{ 125{
126 struct imx_parallel_display *imxpd = enc_to_imxpd(encoder);
127
128 drm_panel_prepare(imxpd->panel);
129 drm_panel_enable(imxpd->panel);
131} 130}
132 131
133static void imx_pd_encoder_mode_set(struct drm_encoder *encoder, 132static void imx_pd_encoder_mode_set(struct drm_encoder *encoder,
@@ -138,6 +137,10 @@ static void imx_pd_encoder_mode_set(struct drm_encoder *encoder,
138 137
139static void imx_pd_encoder_disable(struct drm_encoder *encoder) 138static void imx_pd_encoder_disable(struct drm_encoder *encoder)
140{ 139{
140 struct imx_parallel_display *imxpd = enc_to_imxpd(encoder);
141
142 drm_panel_disable(imxpd->panel);
143 drm_panel_unprepare(imxpd->panel);
141} 144}
142 145
143static struct drm_connector_funcs imx_pd_connector_funcs = { 146static struct drm_connector_funcs imx_pd_connector_funcs = {