diff options
author | Dave Barnish <dave.barnish@arm.com> | 2014-01-24 15:07:14 +0000 |
---|---|---|
committer | Dave Barnish <dave.barnish@arm.com> | 2014-02-14 14:42:25 +0000 |
commit | d67f09704c96364bdb327ce662010b2b36d31d02 (patch) | |
tree | 755ed91f950d43f52270dd32194ae018b37b9cec | |
parent | 32fc97d173b1dd83b4524ee6e2e48bc41624ab7a (diff) |
Added HWCURSOR_API_NONE to the platform specific hwcursor api.
New option allows a software-only cursor to be specified
Change-Id: Ice4bd122ab6b24146d50dcd497a9a70831fc1274
-rw-r--r-- | src/drmmode_display.c | 16 | ||||
-rw-r--r-- | src/drmmode_driver.h | 18 |
2 files changed, 23 insertions, 11 deletions
diff --git a/src/drmmode_display.c b/src/drmmode_display.c index f7b0dc6..b9e59f1 100644 --- a/src/drmmode_display.c +++ b/src/drmmode_display.c @@ -424,7 +424,7 @@ drmmode_hide_cursor(xf86CrtcPtr crtc) /* * The argument "update_image" controls whether the cursor image needs * to be updated by the HW or not. This is ignored by HWCURSOR_API_PLANE - * which doesn't allow changing the cursor possition without updating + * which doesn't allow changing the cursor position without updating * the image too. */ static void @@ -512,7 +512,7 @@ drmmode_set_cursor_position(xf86CrtcPtr crtc, int x, int y) cursor->y = y; /* - * Show the cursor at a different possition without updating the image + * Show the cursor at a different position without updating the image * when possible (HWCURSOR_API_PLANE doesn't have a way to update * cursor position without updating the image too). */ @@ -769,10 +769,16 @@ Bool drmmode_cursor_init(ScreenPtr pScreen) INFO_MSG("HW cursor init()"); - if (pARMSOC->drmmode_interface->cursor_api == HWCURSOR_API_PLANE) + switch (pARMSOC->drmmode_interface->cursor_api) { + case HWCURSOR_API_PLANE: return drmmode_cursor_init_plane(pScreen); - else /* HWCURSOR_API_STANDARD */ + case HWCURSOR_API_STANDARD: return drmmode_cursor_init_standard(pScreen); + case HWCURSOR_API_NONE: + return FALSE; + default: + assert(0); + } } void drmmode_cursor_fini(ScreenPtr pScreen) @@ -1573,7 +1579,7 @@ Bool drmmode_pre_init(ScrnInfoPtr pScrn, int fd, int cpp) TRACE_ENTER(); - drmmode = calloc(1, sizeof *drmmode); + drmmode = calloc(1, sizeof(*drmmode)); if (!drmmode) return FALSE; diff --git a/src/drmmode_driver.h b/src/drmmode_driver.h index 0e802b9..a46042c 100644 --- a/src/drmmode_driver.h +++ b/src/drmmode_driver.h @@ -34,6 +34,7 @@ enum hwcursor_api { HWCURSOR_API_PLANE = 0, HWCURSOR_API_STANDARD = 1, + HWCURSOR_API_NONE = 2 }; struct drmmode_interface { @@ -53,16 +54,21 @@ struct drmmode_interface { */ int cursor_padding; - /* This specifies whether the DRM implements HW cursor support - * using planes or the standard HW cursor API using drmModeSetCursor() - * and drmModeMoveCursor(). + /* Specifies the hardware cursor api used by the DRM : + * HWCURSOR_API_PLANE - Use planes. + * HWCURSOR_API_STANDARD - Use the standard API : drmModeSetCursor() & drmModeMoveCursor(). + * HWCURSOR_API_NONE - No hardware cursor - use a software cursor. */ enum hwcursor_api cursor_api; - /* (Optional) Initialize the given plane for use as a hardware cursor. + /* (Optional) Initialize the hardware cursor plane. * - * This function should do any initialization necessary, for example - * setting the z-order on the plane to appear above all other layers. + * When cursor_api is HWCURSOR_API_PLANE, this function should do any + * plane initialization necessary, for example setting the z-order on the + * plane to appear above all other layers. If this function fails the driver + * falls back to using a software cursor. + * + * If cursor_api is not HWCURSOR_API_PLANE this function should be omitted. * * @param drm_fd The DRM device file * @param plane_id The plane to initialize |