Index: uspace/lib/gfx/include/gfx/cursor.h
===================================================================
--- uspace/lib/gfx/include/gfx/cursor.h	(revision 61bf9dd9428e2f8c95a06cdc0f80d9af3071da4a)
+++ uspace/lib/gfx/include/gfx/cursor.h	(revision 61bf9dd9428e2f8c95a06cdc0f80d9af3071da4a)
@@ -0,0 +1,51 @@
+/*
+ * Copyright (c) 2021 Jiri Svoboda
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * - Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * - The name of the author may not be used to endorse or promote products
+ *   derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/** @addtogroup libgfx
+ * @{
+ */
+/**
+ * @file Hardware cursor control
+ */
+
+#ifndef _GFX_CURSOR_H
+#define _GFX_CURSOR_H
+
+#include <errno.h>
+#include <types/gfx/coord.h>
+#include <types/gfx/context.h>
+#include <stdbool.h>
+
+extern errno_t gfx_cursor_get_pos(gfx_context_t *, gfx_coord2_t *);
+extern errno_t gfx_cursor_set_pos(gfx_context_t *, gfx_coord2_t *);
+extern errno_t gfx_cursor_set_visible(gfx_context_t *, bool);
+
+#endif
+
+/** @}
+ */
Index: uspace/lib/gfx/include/types/gfx/ops/context.h
===================================================================
--- uspace/lib/gfx/include/types/gfx/ops/context.h	(revision 7470d97aaec04abd08ce2ad450cda9e6ff912bd4)
+++ uspace/lib/gfx/include/types/gfx/ops/context.h	(revision 61bf9dd9428e2f8c95a06cdc0f80d9af3071da4a)
@@ -44,4 +44,5 @@
 #include <types/gfx/coord.h>
 #include <types/gfx/context.h>
+#include <stdbool.h>
 
 /** Graphics context ops */
@@ -64,4 +65,10 @@
 	/** Get bitmap allocation info */
 	errno_t (*bitmap_get_alloc)(void *, gfx_bitmap_alloc_t *);
+	/** Get hardware cursor position */
+	errno_t (*cursor_get_pos)(void *, gfx_coord2_t *);
+	/** Set hardware cursor position */
+	errno_t (*cursor_set_pos)(void *, gfx_coord2_t *);
+	/** Set hardware cursor visibility */
+	errno_t (*cursor_set_visible)(void *, bool);
 } gfx_context_ops_t;
 
Index: uspace/lib/gfx/meson.build
===================================================================
--- uspace/lib/gfx/meson.build	(revision 7470d97aaec04abd08ce2ad450cda9e6ff912bd4)
+++ uspace/lib/gfx/meson.build	(revision 61bf9dd9428e2f8c95a06cdc0f80d9af3071da4a)
@@ -1,4 +1,4 @@
 #
-# Copyright (c) 2019 Jiri Svoboda
+# Copyright (c) 2021 Jiri Svoboda
 # All rights reserved.
 #
@@ -32,4 +32,5 @@
 	'src/coord.c',
 	'src/context.c',
+	'src/cursor.c',
 	'src/render.c'
 )
@@ -39,4 +40,5 @@
 	'test/color.c',
 	'test/coord.c',
+	'test/cursor.c',
 	'test/main.c',
 	'test/render.c',
Index: uspace/lib/gfx/src/cursor.c
===================================================================
--- uspace/lib/gfx/src/cursor.c	(revision 61bf9dd9428e2f8c95a06cdc0f80d9af3071da4a)
+++ uspace/lib/gfx/src/cursor.c	(revision 61bf9dd9428e2f8c95a06cdc0f80d9af3071da4a)
@@ -0,0 +1,93 @@
+/*
+ * Copyright (c) 2021 Jiri Svoboda
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * - Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * - The name of the author may not be used to endorse or promote products
+ *   derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/** @addtogroup libgfx
+ * @{
+ */
+/**
+ * @file Hardware cursor control
+ */
+
+#include <errno.h>
+#include <gfx/context.h>
+#include <gfx/coord.h>
+#include <gfx/cursor.h>
+#include <gfx/render.h>
+#include <stdbool.h>
+#include "../private/context.h"
+
+/** Get hardware cursor position.
+ *
+ * @param gc Graphic context
+ * @param pos Place to store cursor position
+ *
+ * @return EOK on success, ENOTSUP if not supported,
+ *         EIO if grahic device connection was lost
+ */
+errno_t gfx_cursor_get_pos(gfx_context_t *gc, gfx_coord2_t *pos)
+{
+	if (gc->ops->cursor_get_pos != NULL)
+		return gc->ops->cursor_get_pos(gc->arg, pos);
+	else
+		return ENOTSUP;
+}
+
+/** Set hardware cursor position.
+ *
+ * @param gc Graphic context
+ * @param pos New cursor position
+ *
+ * @return EOK on success, ENOTSUP if not supported,
+ *         EIO if grahic device connection was lost
+ */
+errno_t gfx_cursor_set_pos(gfx_context_t *gc, gfx_coord2_t *pos)
+{
+	if (gc->ops->cursor_set_pos != NULL)
+		return gc->ops->cursor_set_pos(gc->arg, pos);
+	else
+		return ENOTSUP;
+}
+
+/** Set hardware cursor visibility.
+ *
+ * @param gc Graphic context
+ * @param visible @c true iff cursor should be made visible
+ *
+ * @return EOK on success, ENOTSUP if not supported,
+ *         EIO if grahic device connection was lost
+ */
+errno_t gfx_cursor_set_visible(gfx_context_t *gc, bool visible)
+{
+	if (gc->ops->cursor_set_visible != NULL)
+		return gc->ops->cursor_set_visible(gc->arg, visible);
+	else
+		return ENOTSUP;
+}
+
+/** @}
+ */
Index: uspace/lib/gfx/test/cursor.c
===================================================================
--- uspace/lib/gfx/test/cursor.c	(revision 61bf9dd9428e2f8c95a06cdc0f80d9af3071da4a)
+++ uspace/lib/gfx/test/cursor.c	(revision 61bf9dd9428e2f8c95a06cdc0f80d9af3071da4a)
@@ -0,0 +1,265 @@
+/*
+ * Copyright (c) 2021 Jiri Svoboda
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * - Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * - The name of the author may not be used to endorse or promote products
+ *   derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <gfx/context.h>
+#include <gfx/cursor.h>
+#include <pcut/pcut.h>
+#include <mem.h>
+#include <stdbool.h>
+
+PCUT_INIT;
+
+PCUT_TEST_SUITE(cursor);
+
+static errno_t testgc_cursor_get_pos(void *, gfx_coord2_t *);
+static errno_t testgc_cursor_set_pos(void *, gfx_coord2_t *);
+static errno_t testgc_cursor_set_visible(void *, bool);
+
+static gfx_context_ops_t ops = {
+	.cursor_get_pos = testgc_cursor_get_pos,
+	.cursor_set_pos = testgc_cursor_set_pos,
+	.cursor_set_visible = testgc_cursor_set_visible
+};
+
+/** Test graphics context data */
+typedef struct {
+	errno_t rc;
+
+	bool cursor_get_pos;
+	gfx_coord2_t get_pos_pos;
+
+	bool cursor_set_pos;
+	gfx_coord2_t set_pos_pos;
+
+	bool cursor_set_visible;
+	bool set_visible_vis;
+} test_gc_t;
+
+/** Get hardware cursor position with error return */
+PCUT_TEST(cursor_get_pos_failure)
+{
+	errno_t rc;
+	gfx_coord2_t pos;
+	gfx_context_t *gc = NULL;
+	test_gc_t tgc;
+
+	memset(&tgc, 0, sizeof(tgc));
+
+	rc = gfx_context_new(&ops, &tgc, &gc);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+
+	tgc.rc = EIO;
+
+	rc = gfx_cursor_get_pos(gc, &pos);
+	PCUT_ASSERT_ERRNO_VAL(tgc.rc, rc);
+
+	PCUT_ASSERT_TRUE(tgc.cursor_get_pos);
+
+	rc = gfx_context_delete(gc);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+}
+
+/** Get hardware cursor position */
+PCUT_TEST(cursor_get_pos_success)
+{
+	errno_t rc;
+	gfx_coord2_t pos;
+	gfx_context_t *gc = NULL;
+	test_gc_t tgc;
+
+	memset(&tgc, 0, sizeof(tgc));
+
+	rc = gfx_context_new(&ops, &tgc, &gc);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+
+	tgc.rc = EOK;
+	tgc.get_pos_pos.x = 1;
+	tgc.get_pos_pos.y = 2;
+
+	rc = gfx_cursor_get_pos(gc, &pos);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+
+	PCUT_ASSERT_TRUE(tgc.cursor_get_pos);
+	PCUT_ASSERT_INT_EQUALS(tgc.get_pos_pos.x, pos.x);
+	PCUT_ASSERT_INT_EQUALS(tgc.get_pos_pos.y, pos.y);
+
+	rc = gfx_context_delete(gc);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+}
+
+/** Set hardware cursor position with error return */
+PCUT_TEST(cursor_set_pos_failure)
+{
+	errno_t rc;
+	gfx_coord2_t pos;
+	gfx_context_t *gc = NULL;
+	test_gc_t tgc;
+
+	memset(&tgc, 0, sizeof(tgc));
+
+	rc = gfx_context_new(&ops, &tgc, &gc);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+
+	tgc.rc = EIO;
+	pos.x = 1;
+	pos.y = 2;
+
+	rc = gfx_cursor_set_pos(gc, &pos);
+	PCUT_ASSERT_ERRNO_VAL(tgc.rc, rc);
+
+	PCUT_ASSERT_TRUE(tgc.cursor_set_pos);
+	PCUT_ASSERT_INT_EQUALS(pos.x, tgc.set_pos_pos.x);
+	PCUT_ASSERT_INT_EQUALS(pos.y, tgc.set_pos_pos.y);
+
+	rc = gfx_context_delete(gc);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+}
+
+/** Set hardware cursor position */
+PCUT_TEST(cursor_set_pos_success)
+{
+	errno_t rc;
+	gfx_coord2_t pos;
+	gfx_context_t *gc = NULL;
+	test_gc_t tgc;
+
+	memset(&tgc, 0, sizeof(tgc));
+
+	rc = gfx_context_new(&ops, &tgc, &gc);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+
+	tgc.rc = EOK;
+	pos.x = 1;
+	pos.y = 2;
+
+	rc = gfx_cursor_set_pos(gc, &pos);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+
+	PCUT_ASSERT_TRUE(tgc.cursor_set_pos);
+	PCUT_ASSERT_INT_EQUALS(pos.x, tgc.set_pos_pos.x);
+	PCUT_ASSERT_INT_EQUALS(pos.y, tgc.set_pos_pos.y);
+
+	rc = gfx_context_delete(gc);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+}
+
+/** Set hardware cursor visibility with error return */
+PCUT_TEST(cursor_set_visible_failure)
+{
+	errno_t rc;
+	gfx_context_t *gc = NULL;
+	test_gc_t tgc;
+
+	memset(&tgc, 0, sizeof(tgc));
+
+	rc = gfx_context_new(&ops, &tgc, &gc);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+
+	tgc.rc = EIO;
+
+	rc = gfx_cursor_set_visible(gc, true);
+	PCUT_ASSERT_ERRNO_VAL(tgc.rc, rc);
+
+	PCUT_ASSERT_TRUE(tgc.cursor_set_visible);
+	PCUT_ASSERT_TRUE(tgc.set_visible_vis);
+
+	tgc.cursor_set_visible = false;
+
+	rc = gfx_cursor_set_visible(gc, false);
+	PCUT_ASSERT_ERRNO_VAL(tgc.rc, rc);
+
+	PCUT_ASSERT_TRUE(tgc.cursor_set_visible);
+	PCUT_ASSERT_FALSE(tgc.set_visible_vis);
+
+	rc = gfx_context_delete(gc);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+}
+
+/** Set hardware cursor visibility */
+PCUT_TEST(cursor_set_visible_success)
+{
+	errno_t rc;
+	gfx_context_t *gc = NULL;
+	test_gc_t tgc;
+
+	memset(&tgc, 0, sizeof(tgc));
+
+	rc = gfx_context_new(&ops, &tgc, &gc);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+
+	tgc.rc = EOK;
+
+	rc = gfx_cursor_set_visible(gc, true);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+
+	PCUT_ASSERT_TRUE(tgc.cursor_set_visible);
+	PCUT_ASSERT_TRUE(tgc.set_visible_vis);
+
+	tgc.cursor_set_visible = false;
+
+	rc = gfx_cursor_set_visible(gc, false);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+
+	PCUT_ASSERT_TRUE(tgc.cursor_set_visible);
+	PCUT_ASSERT_FALSE(tgc.set_visible_vis);
+
+	rc = gfx_context_delete(gc);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+}
+
+static errno_t testgc_cursor_get_pos(void *arg, gfx_coord2_t *pos)
+{
+	test_gc_t *tgc = (test_gc_t *) arg;
+
+	tgc->cursor_get_pos = true;
+	*pos = tgc->get_pos_pos;
+
+	return tgc->rc;
+}
+
+static errno_t testgc_cursor_set_pos(void *arg, gfx_coord2_t *pos)
+{
+	test_gc_t *tgc = (test_gc_t *) arg;
+
+	tgc->cursor_set_pos = true;
+	tgc->set_pos_pos = *pos;
+
+	return tgc->rc;
+}
+
+static errno_t testgc_cursor_set_visible(void *arg, bool visible)
+{
+	test_gc_t *tgc = (test_gc_t *) arg;
+
+	tgc->cursor_set_visible = true;
+	tgc->set_visible_vis = visible;
+
+	return tgc->rc;
+}
+
+PCUT_EXPORT(cursor);
Index: uspace/lib/gfx/test/main.c
===================================================================
--- uspace/lib/gfx/test/main.c	(revision 7470d97aaec04abd08ce2ad450cda9e6ff912bd4)
+++ uspace/lib/gfx/test/main.c	(revision 61bf9dd9428e2f8c95a06cdc0f80d9af3071da4a)
@@ -1,4 +1,4 @@
 /*
- * Copyright (c) 2017 Jiri Svoboda
+ * Copyright (c) 2021 Jiri Svoboda
  * All rights reserved.
  *
@@ -34,4 +34,5 @@
 PCUT_IMPORT(color);
 PCUT_IMPORT(coord);
+PCUT_IMPORT(cursor);
 PCUT_IMPORT(render);
 
