drm/tegra: Fix support for Linux v5.9+

The out-of-tree Tegra DRM module that is being maintained for Sidecar
supports Linux v5.9+. Recent upstream changes pulled into the
out-of-tree Tegra DRM broke support for some earlier kernels. Fix
support for all v5.9+ kernel by adding the necessary backwards
compatibility.

JIRA LS-80

Change-Id: I7fb31d979fb0bba35569cbde99815645929b1a49
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2548377
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: Bibek Basu <bbasu@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
This commit is contained in:
Jon Hunter
2021-06-15 19:54:57 +01:00
committed by Laxman Dewangan
parent dce2bcb225
commit 6eb90145f1
2 changed files with 8 additions and 1 deletions

View File

@@ -987,7 +987,13 @@ static void tegra_cursor_atomic_update(struct drm_plane *plane,
x = new_state->dst.x1;
y = new_state->dst.y1;
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 12, 0)
drm_rect_fp_to_int(&src, &new_state->src);
#else
drm_rect_init(&src, new_state->src.x1 >> 16, new_state->src.y1 >> 16,
drm_rect_width(&new_state->src) >> 16,
drm_rect_height(&new_state->src) >> 16);
#endif
value = (src.y1 & tegra->vmask) << 16 | (src.x1 & tegra->hmask);
tegra_dc_writel(dc, value, DC_DISP_PCALC_HEAD_SET_CROPPED_POINT_IN_CURSOR);

View File

@@ -3111,8 +3111,9 @@ static int tegra_sor_init(struct host1x_client *client)
* kernel is possible.
*/
if (sor->rst) {
err = pm_runtime_resume_and_get(sor->dev);
err = pm_runtime_get_sync(sor->dev);
if (err < 0) {
pm_runtime_put_noidle(sor->dev);
dev_err(sor->dev, "failed to get runtime PM: %d\n", err);
return err;
}