Merge tag 'drm-misc-fixes-2020-09-09' of git://anongit.freedesktop.org/drm/drm-misc...
authorDave Airlie <airlied@redhat.com>
Thu, 10 Sep 2020 23:48:43 +0000 (09:48 +1000)
committerDave Airlie <airlied@redhat.com>
Thu, 10 Sep 2020 23:49:23 +0000 (09:49 +1000)
drm-misc-fixes for v5.9-rc5:
- Fix double free in virtio.
- Add missing put_device in sun4i, and other fixes.
- Small ingenic fixes.
- Handle sun4i alpha on lowest plane correctly.
- Remove output->enabled from virtio, as it should use crtc_state.
- Fix tve200 enable/disable.
- Documentation fix.
- Fix virtio unblank.

Signed-off-by: Dave Airlie <airlied@redhat.com>
From: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/478b49d1-b1b3-c983-7056-8a89249be435@mblankhorst.nl
1  2 
drivers/gpu/drm/sun4i/sun4i_tcon.c
drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c

index ced9a8287dd8b1296f466eb50ea9fdf262412164,24d95f058918c53384e0a6c75c035b0627ad70c9..e40c542254f6bb62fca28ea75dfef3e8bc1237d2
@@@ -195,7 -195,7 +195,7 @@@ void sun4i_tcon_set_status(struct sun4i
        switch (encoder->encoder_type) {
        case DRM_MODE_ENCODER_LVDS:
                is_lvds = true;
 -              /* Fallthrough */
 +              fallthrough;
        case DRM_MODE_ENCODER_DSI:
        case DRM_MODE_ENCODER_NONE:
                channel = 0;
@@@ -342,7 -342,7 +342,7 @@@ static void sun4i_tcon0_mode_set_dither
                /* R and B components are only 5 bits deep */
                val |= SUN4I_TCON0_FRM_CTL_MODE_R;
                val |= SUN4I_TCON0_FRM_CTL_MODE_B;
 -              /* Fall through */
 +              fallthrough;
        case MEDIA_BUS_FMT_RGB666_1X18:
        case MEDIA_BUS_FMT_RGB666_1X7X3_SPWG:
                /* Fall through: enable dithering */
@@@ -1433,14 -1433,18 +1433,18 @@@ static int sun8i_r40_tcon_tv_set_mux(st
        if (IS_ENABLED(CONFIG_DRM_SUN8I_TCON_TOP) &&
            encoder->encoder_type == DRM_MODE_ENCODER_TMDS) {
                ret = sun8i_tcon_top_set_hdmi_src(&pdev->dev, id);
-               if (ret)
+               if (ret) {
+                       put_device(&pdev->dev);
                        return ret;
+               }
        }
  
        if (IS_ENABLED(CONFIG_DRM_SUN8I_TCON_TOP)) {
                ret = sun8i_tcon_top_de_config(&pdev->dev, tcon->id, id);
-               if (ret)
+               if (ret) {
+                       put_device(&pdev->dev);
                        return ret;
+               }
        }
  
        return 0;
index 7f13f4d715bf47f6843d0bdec9f508b3632650cd,32d4c3f7fc4eba8d869fdc7d605f34562490fb9d..de8a11abd66a5fc0effc25baea5599bcdd187256
@@@ -889,7 -889,7 +889,7 @@@ static int sun6i_dsi_dcs_write_long(str
        regmap_write(dsi->regs, SUN6I_DSI_CMD_TX_REG(0),
                     sun6i_dsi_dcs_build_pkt_hdr(dsi, msg));
  
-       bounce = kzalloc(msg->tx_len + sizeof(crc), GFP_KERNEL);
+       bounce = kzalloc(ALIGN(msg->tx_len + sizeof(crc), 4), GFP_KERNEL);
        if (!bounce)
                return -ENOMEM;
  
        memcpy((u8 *)bounce + msg->tx_len, &crc, sizeof(crc));
        len += sizeof(crc);
  
-       regmap_bulk_write(dsi->regs, SUN6I_DSI_CMD_TX_REG(1), bounce, len);
+       regmap_bulk_write(dsi->regs, SUN6I_DSI_CMD_TX_REG(1), bounce, DIV_ROUND_UP(len, 4));
        regmap_write(dsi->regs, SUN6I_DSI_CMD_CTL_REG, len + 4 - 1);
        kfree(bounce);
  
@@@ -1027,7 -1027,7 +1027,7 @@@ static ssize_t sun6i_dsi_transfer(struc
                        ret = sun6i_dsi_dcs_read(dsi, msg);
                        break;
                }
 -              /* Else, fall through */
 +              fallthrough;
  
        default:
                ret = -EINVAL;