Skip to content

Commit

Permalink
xen/drm: switch xen_drm_front to use INVALID_GRANT_REF
Browse files Browse the repository at this point in the history
Instead of using a private macro for an invalid grant reference use
the common one.

Signed-off-by: Juergen Gross <[email protected]>
Reviewed-by: Oleksandr Tyshchenko <[email protected]>
Tested-by: Oleksandr Tyshchenko <[email protected]> # Arm64 only
Signed-off-by: Juergen Gross <[email protected]>
  • Loading branch information
jgross1 committed May 19, 2022
1 parent edd81e7 commit cb52163
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 11 deletions.
9 changes: 0 additions & 9 deletions drivers/gpu/drm/xen/xen_drm_front.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,15 +80,6 @@ struct drm_pending_vblank_event;
/* timeout in ms to wait for backend to respond */
#define XEN_DRM_FRONT_WAIT_BACK_MS 3000

#ifndef GRANT_INVALID_REF
/*
* Note on usage of grant reference 0 as invalid grant reference:
* grant reference 0 is valid, but never exposed to a PV driver,
* because of the fact it is already in use/reserved by the PV console.
*/
#define GRANT_INVALID_REF 0
#endif

struct xen_drm_front_info {
struct xenbus_device *xb_dev;
struct xen_drm_front_drm_info *drm_info;
Expand Down
4 changes: 2 additions & 2 deletions drivers/gpu/drm/xen/xen_drm_front_evtchnl.c
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ static void evtchnl_free(struct xen_drm_front_info *front_info,
xenbus_free_evtchn(front_info->xb_dev, evtchnl->port);

/* end access and free the page */
if (evtchnl->gref != GRANT_INVALID_REF)
if (evtchnl->gref != INVALID_GRANT_REF)
gnttab_end_foreign_access(evtchnl->gref, page);

memset(evtchnl, 0, sizeof(*evtchnl));
Expand All @@ -168,7 +168,7 @@ static int evtchnl_alloc(struct xen_drm_front_info *front_info, int index,
evtchnl->index = index;
evtchnl->front_info = front_info;
evtchnl->state = EVTCHNL_STATE_DISCONNECTED;
evtchnl->gref = GRANT_INVALID_REF;
evtchnl->gref = INVALID_GRANT_REF;

page = get_zeroed_page(GFP_NOIO | __GFP_HIGH);
if (!page) {
Expand Down

0 comments on commit cb52163

Please sign in to comment.