drm-misc-fixes for v5.12-rc7:

- Fix use-after-free in xen.
 - Reduce fifo threshold on hvs4 to fix a fifo full error.
 - Disable TE support for Droid4 and N950.
 - Small compiler fixes.
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEuXvWqAysSYEJGuVH/lWMcqZwE8MFAmBwDwIACgkQ/lWMcqZw
 E8MWag/+I50pINOURmQ2RneFatmc+Fj/C0+6KU0FKLAZFvFEsgbtzmJL2Dm8cPqA
 liThf85WEkjzf8PupN7mSvXlGqc9EywnPYr8estXo08GSGCxAjbs7+4p4UkeGhyh
 5N/rK5NodV2mG65l5YLl5NRlqoQEkcmKyU/NztWgrU/1GgBM08lIxrRIIbWw1C5I
 MvmzPDt/S9EP9A1S7LcStTGtU3Ir4TvzL5bEzKkBOgv9v7aqCW6VEyrjq2MdYJ3F
 8NWd84UGaM5QHdQm5YI2bujtWBmwcb1d5dNww4JdrfIZPmXj1f2gl5PLfFis+SxA
 Gbf6nNyMJ+eiFm6gJHrb1HqxcPzMo/qB2JQQqKDLM8J+sP90aJzZIAq2Iwe85RuV
 rwTTsNhKYk0sqNJPLqqO5cI9bmmd7XC8UJpAXqY3t6zDLVE+iilkYcQy/VmsgPgC
 PF60aO+uBem1CSdXOvLDBgGhcH2xoXIZ1RLmT2JvwQjlTl2tWHYRVbs03+moz00X
 OonR/q96xvbfrQghd++JeLpoCbrOu1v8LzJLm43MB44x08sB4AGFNRob4UryQnyL
 /XqoywaMCC/9EzZiNvmORkDZnKJ/UTtn1IyiQnkl/suY850PUuaCz+HI+9FmcYnz
 OoWBDNsOh/bCJKMMo4S+t0oNxDYZ7QXnMk2UflD8Vf98vjFKQX0=
 =iots
 -----END PGP SIGNATURE-----

Merge tag 'drm-misc-fixes-2021-04-09' of git://anongit.freedesktop.org/drm/drm-misc into drm-fixes

drm-misc-fixes for v5.12-rc7:
- Fix use-after-free in xen.
- Reduce fifo threshold on hvs4 to fix a fifo full error.
- Disable TE support for Droid4 and N950.
- Small compiler fixes.

Signed-off-by: Dave Airlie <airlied@redhat.com>

From: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/e7647dd9-60c3-9dfd-a377-89d717212e13@linux.intel.com
This commit is contained in:
Dave Airlie 2021-04-10 05:15:35 +10:00
commit d416bd0bf7
5 changed files with 30 additions and 7 deletions

View File

@ -37,6 +37,7 @@ struct dsic_panel_data {
u32 height_mm;
u32 max_hs_rate;
u32 max_lp_rate;
bool te_support;
};
struct panel_drv_data {
@ -334,9 +335,11 @@ static int dsicm_power_on(struct panel_drv_data *ddata)
if (r)
goto err;
r = mipi_dsi_dcs_set_tear_on(ddata->dsi, MIPI_DSI_DCS_TEAR_MODE_VBLANK);
if (r)
goto err;
if (ddata->panel_data->te_support) {
r = mipi_dsi_dcs_set_tear_on(ddata->dsi, MIPI_DSI_DCS_TEAR_MODE_VBLANK);
if (r)
goto err;
}
/* possible panel bug */
msleep(100);
@ -619,6 +622,7 @@ static const struct dsic_panel_data taal_data = {
.height_mm = 0,
.max_hs_rate = 300000000,
.max_lp_rate = 10000000,
.te_support = true,
};
static const struct dsic_panel_data himalaya_data = {
@ -629,6 +633,7 @@ static const struct dsic_panel_data himalaya_data = {
.height_mm = 88,
.max_hs_rate = 300000000,
.max_lp_rate = 10000000,
.te_support = false,
};
static const struct dsic_panel_data droid4_data = {
@ -639,6 +644,7 @@ static const struct dsic_panel_data droid4_data = {
.height_mm = 89,
.max_hs_rate = 300000000,
.max_lp_rate = 10000000,
.te_support = false,
};
static const struct of_device_id dsicm_of_match[] = {

View File

@ -210,6 +210,7 @@ static u32 vc4_get_fifo_full_level(struct vc4_crtc *vc4_crtc, u32 format)
{
const struct vc4_crtc_data *crtc_data = vc4_crtc_to_vc4_crtc_data(vc4_crtc);
const struct vc4_pv_data *pv_data = vc4_crtc_to_vc4_pv_data(vc4_crtc);
struct vc4_dev *vc4 = to_vc4_dev(vc4_crtc->base.dev);
u32 fifo_len_bytes = pv_data->fifo_depth;
/*
@ -238,6 +239,22 @@ static u32 vc4_get_fifo_full_level(struct vc4_crtc *vc4_crtc, u32 format)
if (crtc_data->hvs_output == 5)
return 32;
/*
* It looks like in some situations, we will overflow
* the PixelValve FIFO (with the bit 10 of PV stat being
* set) and stall the HVS / PV, eventually resulting in
* a page flip timeout.
*
* Displaying the video overlay during a playback with
* Kodi on an RPi3 seems to be a great solution with a
* failure rate around 50%.
*
* Removing 1 from the FIFO full level however
* seems to completely remove that issue.
*/
if (!vc4->hvs->hvs5)
return fifo_len_bytes - 3 * HVS_FIFO_LATENCY_PIX - 1;
return fifo_len_bytes - 3 * HVS_FIFO_LATENCY_PIX;
}
}

View File

@ -1146,7 +1146,6 @@ static void vc4_plane_atomic_async_update(struct drm_plane *plane,
plane->state->src_y = state->src_y;
plane->state->src_w = state->src_w;
plane->state->src_h = state->src_h;
plane->state->src_h = state->src_h;
plane->state->alpha = state->alpha;
plane->state->pixel_blend_mode = state->pixel_blend_mode;
plane->state->rotation = state->rotation;

View File

@ -521,7 +521,7 @@ static int xen_drm_drv_init(struct xen_drm_front_info *front_info)
drm_dev = drm_dev_alloc(&xen_drm_driver, dev);
if (IS_ERR(drm_dev)) {
ret = PTR_ERR(drm_dev);
goto fail;
goto fail_dev;
}
drm_info->drm_dev = drm_dev;
@ -551,8 +551,10 @@ fail_modeset:
drm_kms_helper_poll_fini(drm_dev);
drm_mode_config_cleanup(drm_dev);
drm_dev_put(drm_dev);
fail:
fail_dev:
kfree(drm_info);
front_info->drm_info = NULL;
fail:
return ret;
}

View File

@ -16,7 +16,6 @@
struct drm_connector;
struct xen_drm_front_drm_info;
struct xen_drm_front_drm_info;
int xen_drm_front_conn_init(struct xen_drm_front_drm_info *drm_info,
struct drm_connector *connector);