clear-pkgs-linux-iot-lts2018/1202-drm-i915-gvt-update-cu...

53 lines
1.7 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Liu Xinyun <xinyun.liu@intel.com>
Date: Wed, 24 Apr 2019 17:20:54 +0800
Subject: [PATCH] drm/i915/gvt: update cursor plane ddb
Store updated ddb values in the global gvt struct and force update them
for cursor planes to H/W, even if there is no cursor plane enabled. The
assumption is the service OS set the ddb topology and calculate the
watermark based on the plane/pipe information from the guest OS together
with this fixed ddb values from the service OS.
v2: merge small patches together
Tracked-On: projectacrn/acrn-hypervisor#3106
Signed-off-by: Liu Xinyun <xinyun.liu@intel.com>
Reviewed-by: Zhao Yakui <yakui.zhao@intel.com>
---
drivers/gpu/drm/i915/gvt/gvt.c | 2 ++
drivers/gpu/drm/i915/intel_pm.c | 4 ++++
2 files changed, 6 insertions(+)
diff --git a/drivers/gpu/drm/i915/gvt/gvt.c b/drivers/gpu/drm/i915/gvt/gvt.c
index 9e256a1519ce..89e29b20a538 100644
--- a/drivers/gpu/drm/i915/gvt/gvt.c
+++ b/drivers/gpu/drm/i915/gvt/gvt.c
@@ -351,6 +351,8 @@ void intel_gvt_allocate_ddb(struct intel_gvt *gvt,
ddb->plane[pipe][plane].end =
ddb->plane[pipe][plane].start + plane_size;
}
+
+ memcpy(&gvt->ddb, ddb, sizeof(*ddb));
}
}
diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c
index 57a676e8dfe5..c2ff096bd547 100644
--- a/drivers/gpu/drm/i915/intel_pm.c
+++ b/drivers/gpu/drm/i915/intel_pm.c
@@ -5650,6 +5650,10 @@ static void skl_atomic_update_crtc_wm(struct intel_atomic_state *state,
#endif
}
+#if IS_ENABLED(CONFIG_DRM_I915_GVT)
+ skl_ddb_entry_write(dev_priv, CUR_BUF_CFG(pipe),
+ &dev_priv->gvt->ddb.plane[pipe][PLANE_CURSOR]);
+#endif
return;
}
--
https://clearlinux.org