Re: [PATCH v5 0/1] drm/xen-front: Add support for Xen PV display frontend

From: Oleksandr Andrushchenko
Date: Thu Mar 29 2018 - 05:24:42 EST


On 03/29/2018 12:22 PM, Oleksandr Andrushchenko wrote:
Changes since v4:
For your convenience I am attaching diff between v4..v5
diff --git a/Documentation/gpu/xen-front.rst b/Documentation/gpu/xen-front.rst
index 8188e03c9d23..009d942386c5 100644
--- a/Documentation/gpu/xen-front.rst
+++ b/Documentation/gpu/xen-front.rst
@@ -1,6 +1,6 @@
-====================================
-Xen para-virtualized frontend driver
-====================================
+====================================================
+ drm/xen-front Xen para-virtualized frontend driver
+====================================================

This frontend driver implements Xen para-virtualized display
according to the display protocol described at
diff --git a/drivers/gpu/drm/xen/xen_drm_front_evtchnl.c b/drivers/gpu/drm/xen/xen_drm_front_evtchnl.c
index e521785fd22b..02b6f3d9fe4c 100644
--- a/drivers/gpu/drm/xen/xen_drm_front_evtchnl.c
+++ b/drivers/gpu/drm/xen/xen_drm_front_evtchnl.c
@@ -186,8 +186,10 @@ static int evtchnl_alloc(struct xen_drm_front_info *front_info, int index,
sring, XEN_PAGE_SIZE);

ret = xenbus_grant_ring(xb_dev, sring, 1, &gref);
- if (ret < 0)
+ if (ret < 0) {
+ free_page(page);
goto fail;
+ }

handler = evtchnl_interrupt_ctrl;
} else {
@@ -195,8 +197,10 @@ static int evtchnl_alloc(struct xen_drm_front_info *front_info, int index,

ret = gnttab_grant_foreign_access(xb_dev->otherend_id,
virt_to_gfn((void *)page), 0);
- if (ret < 0)
+ if (ret < 0) {
+ free_page(page);
goto fail;
+ }

gref = ret;
handler = evtchnl_interrupt_evt;
diff --git a/drivers/gpu/drm/xen/xen_drm_front_kms.c b/drivers/gpu/drm/xen/xen_drm_front_kms.c
index 545049dfaf0a..f3ef9dfb4dfb 100644
--- a/drivers/gpu/drm/xen/xen_drm_front_kms.c
+++ b/drivers/gpu/drm/xen/xen_drm_front_kms.c
@@ -107,12 +107,13 @@ static void send_pending_event(struct xen_drm_front_drm_pipeline *pipeline)
}

static void display_enable(struct drm_simple_display_pipe *pipe,
- struct drm_crtc_state *crtc_state)
+ struct drm_crtc_state *crtc_state,
+ struct drm_plane_state *plane_state)
{
struct xen_drm_front_drm_pipeline *pipeline =
to_xen_drm_pipeline(pipe);
struct drm_crtc *crtc = &pipe->crtc;
- struct drm_framebuffer *fb = pipe->plane.state->fb;
+ struct drm_framebuffer *fb = plane_state->fb;
int ret, idx;

if (!drm_dev_enter(pipe->crtc.dev, &idx))
@@ -273,7 +274,7 @@ static void display_update(struct drm_simple_display_pipe *pipe,
drm_dev_exit(idx);
}

-enum drm_mode_status display_mode_valid(struct drm_crtc *crtc,
+static enum drm_mode_status display_mode_valid(struct drm_crtc *crtc,
const struct drm_display_mode *mode)
{
struct xen_drm_front_drm_pipeline *pipeline =