Skip to content

Commit d67f2ec

Browse files
committed
Merge tag 'drm-fixes-2020-09-11' of git://anongit.freedesktop.org/drm/drm
Pull drm fixes from Dave Airlie: "Regular fixes, not much a major amount. One thing though is Laurent fixed some Kconfig issues, and I'm carrying the rapidio kconfig change so the drm one for xlnx driver works. He hadn't got a response from rapidio maintainers. Otherwise, virtio, sun4i, tve200, ingenic have some fixes, one audio fix for i915 and a core docs fix. kconfig: - rapidio/xlnx kconfig fix core: - Documentation fix i915: - audio regression fix virtio: - Fix double free in virtio - Fix virtio unblank - Remove output->enabled from virtio, as it should use crtc_state sun4i: - Add missing put_device in sun4i, and other fixes - Handle sun4i alpha on lowest plane correctly tv200: - Fix tve200 enable/disable ingenic - Small ingenic fixes" * tag 'drm-fixes-2020-09-11' of git://anongit.freedesktop.org/drm/drm: drm/i915: fix regression leading to display audio probe failure on GLK drm: xlnx: dpsub: Fix DMADEVICES Kconfig dependency rapidio: Replace 'select' DMAENGINES 'with depends on' drm/virtio: drop virtio_gpu_output->enabled drm/sun4i: backend: Disable alpha on the lowest plane on the A20 drm/sun4i: backend: Support alpha property on lowest plane drm/sun4i: Fix DE2 YVU handling drm/tve200: Stabilize enable/disable dma-buf: fence-chain: Document missing dma_fence_chain_init() parameter in kerneldoc dma-buf: Fix kerneldoc of dma_buf_set_name() drm/virtio: fix unblank Documentation: fix dma-buf.rst underline length warning drm/sun4i: Fix dsi dcs long write function drm/ingenic: Fix driver not probing when IPU port is missing drm/ingenic: Fix leak of device_node pointer drm/sun4i: add missing put_device() call in sun8i_r40_tcon_tv_set_mux() drm/virtio: Revert "drm/virtio: Call the right shmem helpers"
2 parents b1df2a0 + 7f7a479 commit d67f2ec

File tree

16 files changed

+77
-36
lines changed

16 files changed

+77
-36
lines changed

Documentation/driver-api/dma-buf.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ DMA Fence uABI/Sync File
179179
:internal:
180180

181181
Indefinite DMA Fences
182-
~~~~~~~~~~~~~~~~~~~~
182+
~~~~~~~~~~~~~~~~~~~~~
183183

184184
At various times &dma_fence with an indefinite time until dma_fence_wait()
185185
finishes have been proposed. Examples include:

drivers/dma-buf/dma-buf.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -316,9 +316,9 @@ static __poll_t dma_buf_poll(struct file *file, poll_table *poll)
316316
* name of the dma-buf if the same piece of memory is used for multiple
317317
* purpose between different devices.
318318
*
319-
* @dmabuf [in] dmabuf buffer that will be renamed.
320-
* @buf: [in] A piece of userspace memory that contains the name of
321-
* the dma-buf.
319+
* @dmabuf: [in] dmabuf buffer that will be renamed.
320+
* @buf: [in] A piece of userspace memory that contains the name of
321+
* the dma-buf.
322322
*
323323
* Returns 0 on success. If the dma-buf buffer is already attached to
324324
* devices, return -EBUSY.

drivers/dma-buf/dma-fence-chain.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,7 @@ EXPORT_SYMBOL(dma_fence_chain_ops);
222222
* @chain: the chain node to initialize
223223
* @prev: the previous fence
224224
* @fence: the current fence
225+
* @seqno: the sequence number to use for the fence chain
225226
*
226227
* Initialize a new chain node and either start a new chain or add the node to
227228
* the existing chain of the previous fence.

drivers/gpu/drm/i915/display/intel_display.c

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14956,12 +14956,6 @@ static int intel_atomic_check(struct drm_device *dev,
1495614956
if (dev_priv->wm.distrust_bios_wm)
1495714957
any_ms = true;
1495814958

14959-
if (any_ms) {
14960-
ret = intel_modeset_checks(state);
14961-
if (ret)
14962-
goto fail;
14963-
}
14964-
1496514959
intel_fbc_choose_crtc(dev_priv, state);
1496614960
ret = calc_watermark_data(state);
1496714961
if (ret)
@@ -14976,6 +14970,10 @@ static int intel_atomic_check(struct drm_device *dev,
1497614970
goto fail;
1497714971

1497814972
if (any_ms) {
14973+
ret = intel_modeset_checks(state);
14974+
if (ret)
14975+
goto fail;
14976+
1497914977
ret = intel_modeset_calc_cdclk(state);
1498014978
if (ret)
1498114979
return ret;

drivers/gpu/drm/ingenic/ingenic-drm-drv.c

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -673,7 +673,7 @@ static void ingenic_drm_unbind_all(void *d)
673673
component_unbind_all(priv->dev, &priv->drm);
674674
}
675675

676-
static int ingenic_drm_bind(struct device *dev)
676+
static int ingenic_drm_bind(struct device *dev, bool has_components)
677677
{
678678
struct platform_device *pdev = to_platform_device(dev);
679679
const struct jz_soc_info *soc_info;
@@ -808,7 +808,7 @@ static int ingenic_drm_bind(struct device *dev)
808808
return ret;
809809
}
810810

811-
if (IS_ENABLED(CONFIG_DRM_INGENIC_IPU)) {
811+
if (IS_ENABLED(CONFIG_DRM_INGENIC_IPU) && has_components) {
812812
ret = component_bind_all(dev, drm);
813813
if (ret) {
814814
if (ret != -EPROBE_DEFER)
@@ -939,6 +939,11 @@ static int ingenic_drm_bind(struct device *dev)
939939
return ret;
940940
}
941941

942+
static int ingenic_drm_bind_with_components(struct device *dev)
943+
{
944+
return ingenic_drm_bind(dev, true);
945+
}
946+
942947
static int compare_of(struct device *dev, void *data)
943948
{
944949
return dev->of_node == data;
@@ -957,7 +962,7 @@ static void ingenic_drm_unbind(struct device *dev)
957962
}
958963

959964
static const struct component_master_ops ingenic_master_ops = {
960-
.bind = ingenic_drm_bind,
965+
.bind = ingenic_drm_bind_with_components,
961966
.unbind = ingenic_drm_unbind,
962967
};
963968

@@ -968,16 +973,15 @@ static int ingenic_drm_probe(struct platform_device *pdev)
968973
struct device_node *np;
969974

970975
if (!IS_ENABLED(CONFIG_DRM_INGENIC_IPU))
971-
return ingenic_drm_bind(dev);
976+
return ingenic_drm_bind(dev, false);
972977

973978
/* IPU is at port address 8 */
974979
np = of_graph_get_remote_node(dev->of_node, 8, 0);
975-
if (!np) {
976-
dev_err(dev, "Unable to get IPU node\n");
977-
return -EINVAL;
978-
}
980+
if (!np)
981+
return ingenic_drm_bind(dev, false);
979982

980983
drm_of_component_match_add(dev, &match, compare_of, np);
984+
of_node_put(np);
981985

982986
return component_master_add_with_match(dev, &ingenic_master_ops, match);
983987
}

drivers/gpu/drm/sun4i/sun4i_backend.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -589,8 +589,7 @@ static int sun4i_backend_atomic_check(struct sunxi_engine *engine,
589589

590590
/* We can't have an alpha plane at the lowest position */
591591
if (!backend->quirks->supports_lowest_plane_alpha &&
592-
(plane_states[0]->fb->format->has_alpha ||
593-
(plane_states[0]->alpha != DRM_BLEND_ALPHA_OPAQUE)))
592+
(plane_states[0]->alpha != DRM_BLEND_ALPHA_OPAQUE))
594593
return -EINVAL;
595594

596595
for (i = 1; i < num_planes; i++) {
@@ -995,7 +994,6 @@ static const struct sun4i_backend_quirks sun6i_backend_quirks = {
995994

996995
static const struct sun4i_backend_quirks sun7i_backend_quirks = {
997996
.needs_output_muxing = true,
998-
.supports_lowest_plane_alpha = true,
999997
};
1000998

1001999
static const struct sun4i_backend_quirks sun8i_a33_backend_quirks = {

drivers/gpu/drm/sun4i/sun4i_tcon.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1433,14 +1433,18 @@ static int sun8i_r40_tcon_tv_set_mux(struct sun4i_tcon *tcon,
14331433
if (IS_ENABLED(CONFIG_DRM_SUN8I_TCON_TOP) &&
14341434
encoder->encoder_type == DRM_MODE_ENCODER_TMDS) {
14351435
ret = sun8i_tcon_top_set_hdmi_src(&pdev->dev, id);
1436-
if (ret)
1436+
if (ret) {
1437+
put_device(&pdev->dev);
14371438
return ret;
1439+
}
14381440
}
14391441

14401442
if (IS_ENABLED(CONFIG_DRM_SUN8I_TCON_TOP)) {
14411443
ret = sun8i_tcon_top_de_config(&pdev->dev, tcon->id, id);
1442-
if (ret)
1444+
if (ret) {
1445+
put_device(&pdev->dev);
14431446
return ret;
1447+
}
14441448
}
14451449

14461450
return 0;

drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -889,7 +889,7 @@ static int sun6i_dsi_dcs_write_long(struct sun6i_dsi *dsi,
889889
regmap_write(dsi->regs, SUN6I_DSI_CMD_TX_REG(0),
890890
sun6i_dsi_dcs_build_pkt_hdr(dsi, msg));
891891

892-
bounce = kzalloc(msg->tx_len + sizeof(crc), GFP_KERNEL);
892+
bounce = kzalloc(ALIGN(msg->tx_len + sizeof(crc), 4), GFP_KERNEL);
893893
if (!bounce)
894894
return -ENOMEM;
895895

@@ -900,7 +900,7 @@ static int sun6i_dsi_dcs_write_long(struct sun6i_dsi *dsi,
900900
memcpy((u8 *)bounce + msg->tx_len, &crc, sizeof(crc));
901901
len += sizeof(crc);
902902

903-
regmap_bulk_write(dsi->regs, SUN6I_DSI_CMD_TX_REG(1), bounce, len);
903+
regmap_bulk_write(dsi->regs, SUN6I_DSI_CMD_TX_REG(1), bounce, DIV_ROUND_UP(len, 4));
904904
regmap_write(dsi->regs, SUN6I_DSI_CMD_CTL_REG, len + 4 - 1);
905905
kfree(bounce);
906906

drivers/gpu/drm/sun4i/sun8i_vi_layer.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ static int sun8i_vi_layer_update_coord(struct sun8i_mixer *mixer, int channel,
211211
return 0;
212212
}
213213

214-
static bool sun8i_vi_layer_get_csc_mode(const struct drm_format_info *format)
214+
static u32 sun8i_vi_layer_get_csc_mode(const struct drm_format_info *format)
215215
{
216216
if (!format->is_yuv)
217217
return SUN8I_CSC_MODE_OFF;

drivers/gpu/drm/tve200/tve200_display.c

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
#include <linux/version.h>
1515
#include <linux/dma-buf.h>
1616
#include <linux/of_graph.h>
17+
#include <linux/delay.h>
1718

1819
#include <drm/drm_fb_cma_helper.h>
1920
#include <drm/drm_fourcc.h>
@@ -130,9 +131,25 @@ static void tve200_display_enable(struct drm_simple_display_pipe *pipe,
130131
struct drm_connector *connector = priv->connector;
131132
u32 format = fb->format->format;
132133
u32 ctrl1 = 0;
134+
int retries;
133135

134136
clk_prepare_enable(priv->clk);
135137

138+
/* Reset the TVE200 and wait for it to come back online */
139+
writel(TVE200_CTRL_4_RESET, priv->regs + TVE200_CTRL_4);
140+
for (retries = 0; retries < 5; retries++) {
141+
usleep_range(30000, 50000);
142+
if (readl(priv->regs + TVE200_CTRL_4) & TVE200_CTRL_4_RESET)
143+
continue;
144+
else
145+
break;
146+
}
147+
if (retries == 5 &&
148+
readl(priv->regs + TVE200_CTRL_4) & TVE200_CTRL_4_RESET) {
149+
dev_err(drm->dev, "can't get hardware out of reset\n");
150+
return;
151+
}
152+
136153
/* Function 1 */
137154
ctrl1 |= TVE200_CTRL_CSMODE;
138155
/* Interlace mode for CCIR656: parameterize? */
@@ -230,8 +247,9 @@ static void tve200_display_disable(struct drm_simple_display_pipe *pipe)
230247

231248
drm_crtc_vblank_off(crtc);
232249

233-
/* Disable and Power Down */
250+
/* Disable put into reset and Power Down */
234251
writel(0, priv->regs + TVE200_CTRL);
252+
writel(TVE200_CTRL_4_RESET, priv->regs + TVE200_CTRL_4);
235253

236254
clk_disable_unprepare(priv->clk);
237255
}
@@ -279,6 +297,8 @@ static int tve200_display_enable_vblank(struct drm_simple_display_pipe *pipe)
279297
struct drm_device *drm = crtc->dev;
280298
struct tve200_drm_dev_private *priv = drm->dev_private;
281299

300+
/* Clear any IRQs and enable */
301+
writel(0xFF, priv->regs + TVE200_INT_CLR);
282302
writel(TVE200_INT_V_STATUS, priv->regs + TVE200_INT_EN);
283303
return 0;
284304
}

0 commit comments

Comments
 (0)