drm/tegra: Fixes for v5.17-rc6

Contains a couple of fixes for Tegra186 suspend/resume, syncpoint
 waiting, a build warning and eDP on older Tegra devices.
 -----BEGIN PGP SIGNATURE-----
 
 iQJHBAABCAAxFiEEiOrDCAFJzPfAjcif3SOs138+s6EFAmIWL34THHRyZWRpbmdA
 bnZpZGlhLmNvbQAKCRDdI6zXfz6zob5bD/wOh2XS1U2/VPZtodJE4PbJm9MQmVyU
 E6wvMx4ZophB3zXtd25ki4uvPkTcEOcp52kSLeMtzyVIcqkxuSMbYJ1Px3YnB6/5
 a3MYwHAq7O3/DLzF23NgOHI4AQlwYRIymSvMVKMwTj9ycYmRpEVK/kAkIAxUocIo
 xJXDwDfsSHXqoeJga4dE4J3DihD0KUAOzuS+Ya8ORTfKwKtypYCvghO5TybtPUNL
 L9dzJBdUBaBioqkca4ObtQWWxlyTZ4nfjIW0Ji1EEbQAeKA3BinLzeq+3U2lS1DN
 OOV7CTvs2RAwjGCRTGKhodgOrt0slrkOw2ZI0L36E3lznJiptlv0O3Qp4UsungzM
 bvsgGBzuD66V50hx7dp7DMthgVqVKMrPJuzrOUsf4yu7rnBHOR4fE4YHk0jSKOaS
 ZHzEFxzeRsyhADyoLgFhJzSm9uNugEyPu5170EZLz3GQ1f8U6rlfUqCYtPcWH+F2
 uNd7i4Zd8xhZTzQX+WENz2AEKlOuWIDZJ7qrJQXcn/Mccupy8E43ITjGStXuiS7L
 VUY49YnIF5QrCNBkvzpgFYlb5N6LBNxv+WlBjz/hbOIOX6O/QJ6RuuIrGgOE1hwQ
 ja4CQpFuqrfIZHraUCwWWaiaZX+KNQfnrOJbtpkXgZQqDEjmHoSv48pjCc1E5MpN
 917feFEZokbpsg==
 =O3hK
 -----END PGP SIGNATURE-----

Merge tag 'drm/tegra/for-5.17-rc6' of https://gitlab.freedesktop.org/drm/tegra into drm-fixes

drm/tegra: Fixes for v5.17-rc6

Contains a couple of fixes for Tegra186 suspend/resume, syncpoint
waiting, a build warning and eDP on older Tegra devices.

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

From: Thierry Reding <thierry.reding@gmail.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220223161903.293392-1-thierry.reding@gmail.com
This commit is contained in:
Dave Airlie 2022-02-24 14:21:57 +10:00
commit 0c3127933c
4 changed files with 19 additions and 26 deletions

View file

@ -5,6 +5,7 @@ config DRM_TEGRA
depends on COMMON_CLK
depends on DRM
depends on OF
select DRM_DP_AUX_BUS
select DRM_KMS_HELPER
select DRM_MIPI_DSI
select DRM_PANEL

View file

@ -19,6 +19,7 @@
#include <linux/workqueue.h>
#include <drm/drm_dp_helper.h>
#include <drm/drm_dp_aux_bus.h>
#include <drm/drm_panel.h>
#include "dp.h"
@ -570,6 +571,12 @@ static int tegra_dpaux_probe(struct platform_device *pdev)
list_add_tail(&dpaux->list, &dpaux_list);
mutex_unlock(&dpaux_lock);
err = devm_of_dp_aux_populate_ep_devices(&dpaux->aux);
if (err < 0) {
dev_err(dpaux->dev, "failed to populate AUX bus: %d\n", err);
return err;
}
return 0;
}

View file

@ -63,7 +63,7 @@ static void falcon_copy_firmware_image(struct falcon *falcon,
/* copy the whole thing taking into account endianness */
for (i = 0; i < firmware->size / sizeof(u32); i++)
virt[i] = le32_to_cpu(((u32 *)firmware->data)[i]);
virt[i] = le32_to_cpu(((__le32 *)firmware->data)[i]);
}
static int falcon_parse_firmware_image(struct falcon *falcon)

View file

@ -137,8 +137,15 @@ void host1x_syncpt_restore(struct host1x *host)
struct host1x_syncpt *sp_base = host->syncpt;
unsigned int i;
for (i = 0; i < host1x_syncpt_nb_pts(host); i++)
for (i = 0; i < host1x_syncpt_nb_pts(host); i++) {
/*
* Unassign syncpt from channels for purposes of Tegra186
* syncpoint protection. This prevents any channel from
* accessing it until it is reassigned.
*/
host1x_hw_syncpt_assign_to_channel(host, sp_base + i, NULL);
host1x_hw_syncpt_restore(host, sp_base + i);
}
for (i = 0; i < host1x_syncpt_nb_bases(host); i++)
host1x_hw_syncpt_restore_wait_base(host, sp_base + i);
@ -227,27 +234,12 @@ int host1x_syncpt_wait(struct host1x_syncpt *sp, u32 thresh, long timeout,
void *ref;
struct host1x_waitlist *waiter;
int err = 0, check_count = 0;
u32 val;
if (value)
*value = 0;
/* first check cache */
if (host1x_syncpt_is_expired(sp, thresh)) {
if (value)
*value = host1x_syncpt_load(sp);
*value = host1x_syncpt_load(sp);
if (host1x_syncpt_is_expired(sp, thresh))
return 0;
}
/* try to read from register */
val = host1x_hw_syncpt_load(sp->host, sp);
if (host1x_syncpt_is_expired(sp, thresh)) {
if (value)
*value = val;
goto done;
}
if (!timeout) {
err = -EAGAIN;
@ -352,13 +344,6 @@ int host1x_syncpt_init(struct host1x *host)
for (i = 0; i < host->info->nb_pts; i++) {
syncpt[i].id = i;
syncpt[i].host = host;
/*
* Unassign syncpt from channels for purposes of Tegra186
* syncpoint protection. This prevents any channel from
* accessing it until it is reassigned.
*/
host1x_hw_syncpt_assign_to_channel(host, &syncpt[i], NULL);
}
for (i = 0; i < host->info->nb_bases; i++)