aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/gpu/drm/bridge/Kconfig1
-rw-r--r--drivers/gpu/drm/drm_atomic.c8
-rw-r--r--drivers/gpu/drm/omapdrm/dss/dispc.c20
-rw-r--r--drivers/gpu/drm/omapdrm/dss/hdmi4.c2
-rw-r--r--drivers/gpu/drm/omapdrm/dss/hdmi4_core.c7
-rw-r--r--drivers/gpu/drm/omapdrm/dss/hdmi5.c2
-rw-r--r--drivers/gpu/drm/omapdrm/omap_connector.c10
-rw-r--r--drivers/gpu/drm/omapdrm/omap_dmm_tiler.c6
-rw-r--r--drivers/gpu/drm/omapdrm/tcm-sita.c2
-rw-r--r--drivers/gpu/drm/vc4/vc4_dpi.c25
-rw-r--r--drivers/gpu/drm/vc4/vc4_plane.c2
11 files changed, 69 insertions, 16 deletions
diff --git a/drivers/gpu/drm/bridge/Kconfig b/drivers/gpu/drm/bridge/Kconfig
index 3aa65bdecb0e..684ac626ac53 100644
--- a/drivers/gpu/drm/bridge/Kconfig
+++ b/drivers/gpu/drm/bridge/Kconfig
@@ -74,6 +74,7 @@ config DRM_SIL_SII8620
74 tristate "Silicon Image SII8620 HDMI/MHL bridge" 74 tristate "Silicon Image SII8620 HDMI/MHL bridge"
75 depends on OF && RC_CORE 75 depends on OF && RC_CORE
76 select DRM_KMS_HELPER 76 select DRM_KMS_HELPER
77 imply EXTCON
77 help 78 help
78 Silicon Image SII8620 HDMI/MHL bridge chip driver. 79 Silicon Image SII8620 HDMI/MHL bridge chip driver.
79 80
diff --git a/drivers/gpu/drm/drm_atomic.c b/drivers/gpu/drm/drm_atomic.c
index 7d25c42f22db..c825c76edc1d 100644
--- a/drivers/gpu/drm/drm_atomic.c
+++ b/drivers/gpu/drm/drm_atomic.c
@@ -155,6 +155,8 @@ void drm_atomic_state_default_clear(struct drm_atomic_state *state)
155 state->connectors[i].state); 155 state->connectors[i].state);
156 state->connectors[i].ptr = NULL; 156 state->connectors[i].ptr = NULL;
157 state->connectors[i].state = NULL; 157 state->connectors[i].state = NULL;
158 state->connectors[i].old_state = NULL;
159 state->connectors[i].new_state = NULL;
158 drm_connector_put(connector); 160 drm_connector_put(connector);
159 } 161 }
160 162
@@ -169,6 +171,8 @@ void drm_atomic_state_default_clear(struct drm_atomic_state *state)
169 171
170 state->crtcs[i].ptr = NULL; 172 state->crtcs[i].ptr = NULL;
171 state->crtcs[i].state = NULL; 173 state->crtcs[i].state = NULL;
174 state->crtcs[i].old_state = NULL;
175 state->crtcs[i].new_state = NULL;
172 } 176 }
173 177
174 for (i = 0; i < config->num_total_plane; i++) { 178 for (i = 0; i < config->num_total_plane; i++) {
@@ -181,6 +185,8 @@ void drm_atomic_state_default_clear(struct drm_atomic_state *state)
181 state->planes[i].state); 185 state->planes[i].state);
182 state->planes[i].ptr = NULL; 186 state->planes[i].ptr = NULL;
183 state->planes[i].state = NULL; 187 state->planes[i].state = NULL;
188 state->planes[i].old_state = NULL;
189 state->planes[i].new_state = NULL;
184 } 190 }
185 191
186 for (i = 0; i < state->num_private_objs; i++) { 192 for (i = 0; i < state->num_private_objs; i++) {
@@ -190,6 +196,8 @@ void drm_atomic_state_default_clear(struct drm_atomic_state *state)
190 state->private_objs[i].state); 196 state->private_objs[i].state);
191 state->private_objs[i].ptr = NULL; 197 state->private_objs[i].ptr = NULL;
192 state->private_objs[i].state = NULL; 198 state->private_objs[i].state = NULL;
199 state->private_objs[i].old_state = NULL;
200 state->private_objs[i].new_state = NULL;
193 } 201 }
194 state->num_private_objs = 0; 202 state->num_private_objs = 0;
195 203
diff --git a/drivers/gpu/drm/omapdrm/dss/dispc.c b/drivers/gpu/drm/omapdrm/dss/dispc.c
index 5e2e65e88847..7f3ac6b13b56 100644
--- a/drivers/gpu/drm/omapdrm/dss/dispc.c
+++ b/drivers/gpu/drm/omapdrm/dss/dispc.c
@@ -828,6 +828,12 @@ static void dispc_ovl_set_scale_coef(struct dispc_device *dispc,
828 h_coef = dispc_ovl_get_scale_coef(fir_hinc, true); 828 h_coef = dispc_ovl_get_scale_coef(fir_hinc, true);
829 v_coef = dispc_ovl_get_scale_coef(fir_vinc, five_taps); 829 v_coef = dispc_ovl_get_scale_coef(fir_vinc, five_taps);
830 830
831 if (!h_coef || !v_coef) {
832 dev_err(&dispc->pdev->dev, "%s: failed to find scale coefs\n",
833 __func__);
834 return;
835 }
836
831 for (i = 0; i < 8; i++) { 837 for (i = 0; i < 8; i++) {
832 u32 h, hv; 838 u32 h, hv;
833 839
@@ -2342,7 +2348,7 @@ static int dispc_ovl_calc_scaling_24xx(struct dispc_device *dispc,
2342 } 2348 }
2343 2349
2344 if (in_width > maxsinglelinewidth) { 2350 if (in_width > maxsinglelinewidth) {
2345 DSSERR("Cannot scale max input width exceeded"); 2351 DSSERR("Cannot scale max input width exceeded\n");
2346 return -EINVAL; 2352 return -EINVAL;
2347 } 2353 }
2348 return 0; 2354 return 0;
@@ -2424,13 +2430,13 @@ again:
2424 } 2430 }
2425 2431
2426 if (in_width > (maxsinglelinewidth * 2)) { 2432 if (in_width > (maxsinglelinewidth * 2)) {
2427 DSSERR("Cannot setup scaling"); 2433 DSSERR("Cannot setup scaling\n");
2428 DSSERR("width exceeds maximum width possible"); 2434 DSSERR("width exceeds maximum width possible\n");
2429 return -EINVAL; 2435 return -EINVAL;
2430 } 2436 }
2431 2437
2432 if (in_width > maxsinglelinewidth && *five_taps) { 2438 if (in_width > maxsinglelinewidth && *five_taps) {
2433 DSSERR("cannot setup scaling with five taps"); 2439 DSSERR("cannot setup scaling with five taps\n");
2434 return -EINVAL; 2440 return -EINVAL;
2435 } 2441 }
2436 return 0; 2442 return 0;
@@ -2472,7 +2478,7 @@ static int dispc_ovl_calc_scaling_44xx(struct dispc_device *dispc,
2472 in_width > maxsinglelinewidth && ++*decim_x); 2478 in_width > maxsinglelinewidth && ++*decim_x);
2473 2479
2474 if (in_width > maxsinglelinewidth) { 2480 if (in_width > maxsinglelinewidth) {
2475 DSSERR("Cannot scale width exceeds max line width"); 2481 DSSERR("Cannot scale width exceeds max line width\n");
2476 return -EINVAL; 2482 return -EINVAL;
2477 } 2483 }
2478 2484
@@ -2490,7 +2496,7 @@ static int dispc_ovl_calc_scaling_44xx(struct dispc_device *dispc,
2490 * bandwidth. Despite what theory says this appears to 2496 * bandwidth. Despite what theory says this appears to
2491 * be true also for 16-bit color formats. 2497 * be true also for 16-bit color formats.
2492 */ 2498 */
2493 DSSERR("Not enough bandwidth, too much downscaling (x-decimation factor %d > 4)", *decim_x); 2499 DSSERR("Not enough bandwidth, too much downscaling (x-decimation factor %d > 4)\n", *decim_x);
2494 2500
2495 return -EINVAL; 2501 return -EINVAL;
2496 } 2502 }
@@ -4633,7 +4639,7 @@ static int dispc_errata_i734_wa_init(struct dispc_device *dispc)
4633 i734_buf.size, &i734_buf.paddr, 4639 i734_buf.size, &i734_buf.paddr,
4634 GFP_KERNEL); 4640 GFP_KERNEL);
4635 if (!i734_buf.vaddr) { 4641 if (!i734_buf.vaddr) {
4636 dev_err(&dispc->pdev->dev, "%s: dma_alloc_writecombine failed", 4642 dev_err(&dispc->pdev->dev, "%s: dma_alloc_writecombine failed\n",
4637 __func__); 4643 __func__);
4638 return -ENOMEM; 4644 return -ENOMEM;
4639 } 4645 }
diff --git a/drivers/gpu/drm/omapdrm/dss/hdmi4.c b/drivers/gpu/drm/omapdrm/dss/hdmi4.c
index 97c88861d67a..5879f45f6fc9 100644
--- a/drivers/gpu/drm/omapdrm/dss/hdmi4.c
+++ b/drivers/gpu/drm/omapdrm/dss/hdmi4.c
@@ -679,7 +679,7 @@ static int hdmi_audio_config(struct device *dev,
679 struct omap_dss_audio *dss_audio) 679 struct omap_dss_audio *dss_audio)
680{ 680{
681 struct omap_hdmi *hd = dev_get_drvdata(dev); 681 struct omap_hdmi *hd = dev_get_drvdata(dev);
682 int ret; 682 int ret = 0;
683 683
684 mutex_lock(&hd->lock); 684 mutex_lock(&hd->lock);
685 685
diff --git a/drivers/gpu/drm/omapdrm/dss/hdmi4_core.c b/drivers/gpu/drm/omapdrm/dss/hdmi4_core.c
index 35ed2add6189..813ba42f2753 100644
--- a/drivers/gpu/drm/omapdrm/dss/hdmi4_core.c
+++ b/drivers/gpu/drm/omapdrm/dss/hdmi4_core.c
@@ -922,8 +922,13 @@ int hdmi4_core_init(struct platform_device *pdev, struct hdmi_core_data *core)
922{ 922{
923 const struct hdmi4_features *features; 923 const struct hdmi4_features *features;
924 struct resource *res; 924 struct resource *res;
925 const struct soc_device_attribute *soc;
925 926
926 features = soc_device_match(hdmi4_soc_devices)->data; 927 soc = soc_device_match(hdmi4_soc_devices);
928 if (!soc)
929 return -ENODEV;
930
931 features = soc->data;
927 core->cts_swmode = features->cts_swmode; 932 core->cts_swmode = features->cts_swmode;
928 core->audio_use_mclk = features->audio_use_mclk; 933 core->audio_use_mclk = features->audio_use_mclk;
929 934
diff --git a/drivers/gpu/drm/omapdrm/dss/hdmi5.c b/drivers/gpu/drm/omapdrm/dss/hdmi5.c
index d28da9ac3e90..ae1a001d1b83 100644
--- a/drivers/gpu/drm/omapdrm/dss/hdmi5.c
+++ b/drivers/gpu/drm/omapdrm/dss/hdmi5.c
@@ -671,7 +671,7 @@ static int hdmi_audio_config(struct device *dev,
671 struct omap_dss_audio *dss_audio) 671 struct omap_dss_audio *dss_audio)
672{ 672{
673 struct omap_hdmi *hd = dev_get_drvdata(dev); 673 struct omap_hdmi *hd = dev_get_drvdata(dev);
674 int ret; 674 int ret = 0;
675 675
676 mutex_lock(&hd->lock); 676 mutex_lock(&hd->lock);
677 677
diff --git a/drivers/gpu/drm/omapdrm/omap_connector.c b/drivers/gpu/drm/omapdrm/omap_connector.c
index a0d7b1d905e8..5cde26ac937b 100644
--- a/drivers/gpu/drm/omapdrm/omap_connector.c
+++ b/drivers/gpu/drm/omapdrm/omap_connector.c
@@ -121,6 +121,9 @@ static int omap_connector_get_modes(struct drm_connector *connector)
121 if (dssdrv->read_edid) { 121 if (dssdrv->read_edid) {
122 void *edid = kzalloc(MAX_EDID, GFP_KERNEL); 122 void *edid = kzalloc(MAX_EDID, GFP_KERNEL);
123 123
124 if (!edid)
125 return 0;
126
124 if ((dssdrv->read_edid(dssdev, edid, MAX_EDID) > 0) && 127 if ((dssdrv->read_edid(dssdev, edid, MAX_EDID) > 0) &&
125 drm_edid_is_valid(edid)) { 128 drm_edid_is_valid(edid)) {
126 drm_mode_connector_update_edid_property( 129 drm_mode_connector_update_edid_property(
@@ -139,6 +142,9 @@ static int omap_connector_get_modes(struct drm_connector *connector)
139 struct drm_display_mode *mode = drm_mode_create(dev); 142 struct drm_display_mode *mode = drm_mode_create(dev);
140 struct videomode vm = {0}; 143 struct videomode vm = {0};
141 144
145 if (!mode)
146 return 0;
147
142 dssdrv->get_timings(dssdev, &vm); 148 dssdrv->get_timings(dssdev, &vm);
143 149
144 drm_display_mode_from_videomode(&vm, mode); 150 drm_display_mode_from_videomode(&vm, mode);
@@ -200,6 +206,10 @@ static int omap_connector_mode_valid(struct drm_connector *connector,
200 if (!r) { 206 if (!r) {
201 /* check if vrefresh is still valid */ 207 /* check if vrefresh is still valid */
202 new_mode = drm_mode_duplicate(dev, mode); 208 new_mode = drm_mode_duplicate(dev, mode);
209
210 if (!new_mode)
211 return MODE_BAD;
212
203 new_mode->clock = vm.pixelclock / 1000; 213 new_mode->clock = vm.pixelclock / 1000;
204 new_mode->vrefresh = 0; 214 new_mode->vrefresh = 0;
205 if (mode->vrefresh == drm_mode_vrefresh(new_mode)) 215 if (mode->vrefresh == drm_mode_vrefresh(new_mode))
diff --git a/drivers/gpu/drm/omapdrm/omap_dmm_tiler.c b/drivers/gpu/drm/omapdrm/omap_dmm_tiler.c
index f9fa1c90b35c..401c02e9e6b2 100644
--- a/drivers/gpu/drm/omapdrm/omap_dmm_tiler.c
+++ b/drivers/gpu/drm/omapdrm/omap_dmm_tiler.c
@@ -401,12 +401,16 @@ int tiler_unpin(struct tiler_block *block)
401struct tiler_block *tiler_reserve_2d(enum tiler_fmt fmt, u16 w, 401struct tiler_block *tiler_reserve_2d(enum tiler_fmt fmt, u16 w,
402 u16 h, u16 align) 402 u16 h, u16 align)
403{ 403{
404 struct tiler_block *block = kzalloc(sizeof(*block), GFP_KERNEL); 404 struct tiler_block *block;
405 u32 min_align = 128; 405 u32 min_align = 128;
406 int ret; 406 int ret;
407 unsigned long flags; 407 unsigned long flags;
408 u32 slot_bytes; 408 u32 slot_bytes;
409 409
410 block = kzalloc(sizeof(*block), GFP_KERNEL);
411 if (!block)
412 return ERR_PTR(-ENOMEM);
413
410 BUG_ON(!validfmt(fmt)); 414 BUG_ON(!validfmt(fmt));
411 415
412 /* convert width/height to slots */ 416 /* convert width/height to slots */
diff --git a/drivers/gpu/drm/omapdrm/tcm-sita.c b/drivers/gpu/drm/omapdrm/tcm-sita.c
index d7f7bc9f061a..817be3c41863 100644
--- a/drivers/gpu/drm/omapdrm/tcm-sita.c
+++ b/drivers/gpu/drm/omapdrm/tcm-sita.c
@@ -90,7 +90,7 @@ static int l2r_t2b(u16 w, u16 h, u16 a, s16 offset,
90{ 90{
91 int i; 91 int i;
92 unsigned long index; 92 unsigned long index;
93 bool area_free; 93 bool area_free = false;
94 unsigned long slots_per_band = PAGE_SIZE / slot_bytes; 94 unsigned long slots_per_band = PAGE_SIZE / slot_bytes;
95 unsigned long bit_offset = (offset > 0) ? offset / slot_bytes : 0; 95 unsigned long bit_offset = (offset > 0) ? offset / slot_bytes : 0;
96 unsigned long curr_bit = bit_offset; 96 unsigned long curr_bit = bit_offset;
diff --git a/drivers/gpu/drm/vc4/vc4_dpi.c b/drivers/gpu/drm/vc4/vc4_dpi.c
index 72c9dbd81d7f..f185812970da 100644
--- a/drivers/gpu/drm/vc4/vc4_dpi.c
+++ b/drivers/gpu/drm/vc4/vc4_dpi.c
@@ -96,7 +96,6 @@ struct vc4_dpi {
96 struct platform_device *pdev; 96 struct platform_device *pdev;
97 97
98 struct drm_encoder *encoder; 98 struct drm_encoder *encoder;
99 struct drm_connector *connector;
100 99
101 void __iomem *regs; 100 void __iomem *regs;
102 101
@@ -164,14 +163,31 @@ static void vc4_dpi_encoder_disable(struct drm_encoder *encoder)
164 163
165static void vc4_dpi_encoder_enable(struct drm_encoder *encoder) 164static void vc4_dpi_encoder_enable(struct drm_encoder *encoder)
166{ 165{
166 struct drm_device *dev = encoder->dev;
167 struct drm_display_mode *mode = &encoder->crtc->mode; 167 struct drm_display_mode *mode = &encoder->crtc->mode;
168 struct vc4_dpi_encoder *vc4_encoder = to_vc4_dpi_encoder(encoder); 168 struct vc4_dpi_encoder *vc4_encoder = to_vc4_dpi_encoder(encoder);
169 struct vc4_dpi *dpi = vc4_encoder->dpi; 169 struct vc4_dpi *dpi = vc4_encoder->dpi;
170 struct drm_connector_list_iter conn_iter;
171 struct drm_connector *connector = NULL, *connector_scan;
170 u32 dpi_c = DPI_ENABLE | DPI_OUTPUT_ENABLE_MODE; 172 u32 dpi_c = DPI_ENABLE | DPI_OUTPUT_ENABLE_MODE;
171 int ret; 173 int ret;
172 174
173 if (dpi->connector->display_info.num_bus_formats) { 175 /* Look up the connector attached to DPI so we can get the
174 u32 bus_format = dpi->connector->display_info.bus_formats[0]; 176 * bus_format. Ideally the bridge would tell us the
177 * bus_format we want, but it doesn't yet, so assume that it's
178 * uniform throughout the bridge chain.
179 */
180 drm_connector_list_iter_begin(dev, &conn_iter);
181 drm_for_each_connector_iter(connector_scan, &conn_iter) {
182 if (connector_scan->encoder == encoder) {
183 connector = connector_scan;
184 break;
185 }
186 }
187 drm_connector_list_iter_end(&conn_iter);
188
189 if (connector && connector->display_info.num_bus_formats) {
190 u32 bus_format = connector->display_info.bus_formats[0];
175 191
176 switch (bus_format) { 192 switch (bus_format) {
177 case MEDIA_BUS_FMT_RGB888_1X24: 193 case MEDIA_BUS_FMT_RGB888_1X24:
@@ -199,6 +215,9 @@ static void vc4_dpi_encoder_enable(struct drm_encoder *encoder)
199 DRM_ERROR("Unknown media bus format %d\n", bus_format); 215 DRM_ERROR("Unknown media bus format %d\n", bus_format);
200 break; 216 break;
201 } 217 }
218 } else {
219 /* Default to 24bit if no connector found. */
220 dpi_c |= VC4_SET_FIELD(DPI_FORMAT_24BIT_888_RGB, DPI_FORMAT);
202 } 221 }
203 222
204 if (mode->flags & DRM_MODE_FLAG_NHSYNC) 223 if (mode->flags & DRM_MODE_FLAG_NHSYNC)
diff --git a/drivers/gpu/drm/vc4/vc4_plane.c b/drivers/gpu/drm/vc4/vc4_plane.c
index ce39390be389..13dcaad06798 100644
--- a/drivers/gpu/drm/vc4/vc4_plane.c
+++ b/drivers/gpu/drm/vc4/vc4_plane.c
@@ -503,7 +503,7 @@ static int vc4_plane_mode_set(struct drm_plane *plane,
503 * the scl fields here. 503 * the scl fields here.
504 */ 504 */
505 if (num_planes == 1) { 505 if (num_planes == 1) {
506 scl0 = vc4_get_scl_field(state, 1); 506 scl0 = vc4_get_scl_field(state, 0);
507 scl1 = scl0; 507 scl1 = scl0;
508 } else { 508 } else {
509 scl0 = vc4_get_scl_field(state, 1); 509 scl0 = vc4_get_scl_field(state, 1);