Index: uspace/app/gfxdemo/gfxdemo.c
===================================================================
--- uspace/app/gfxdemo/gfxdemo.c	(revision aac506977cd4c2bd4f4d8d877a8e9b457321b790)
+++ uspace/app/gfxdemo/gfxdemo.c	(revision c8cf261a450bf22fa6cc6e9872a1f07f9e7dccda)
@@ -36,4 +36,5 @@
 #include <congfx/console.h>
 #include <draw/surface.h>
+#include <display.h>
 #include <fibril.h>
 #include <guigfx/canvas.h>
@@ -117,5 +118,4 @@
 static errno_t demo_canvas(void)
 {
-	console_ctrl_t *con = NULL;
 	canvas_gc_t *cgc = NULL;
 	gfx_context_t *gc;
@@ -128,7 +128,4 @@
 
 	printf("Init canvas..\n");
-	con = console_init(stdin, stdout);
-	if (con == NULL)
-		return EIO;
 
 	window = window_open("comp:0/winreg", NULL,
@@ -145,5 +142,5 @@
 	if (pixbuf == NULL) {
 		printf("Error allocating memory for pixel buffer.\n");
-		return -1;
+		return ENOMEM;
 	}
 
@@ -151,5 +148,5 @@
 	if (surface == NULL) {
 		printf("Error creating surface.\n");
-		return -1;
+		return EIO;
 	}
 
@@ -158,5 +155,5 @@
 	if (canvas == NULL) {
 		printf("Error creating canvas.\n");
-		return -1;
+		return EIO;
 	}
 
@@ -182,7 +179,45 @@
 }
 
+/** Run demo on display server. */
+static errno_t demo_display(void)
+{
+	display_t *display = NULL;
+	gfx_context_t *gc;
+	display_window_t *window = NULL;
+	errno_t rc;
+
+	printf("Init display..\n");
+
+	rc = display_open(NULL, &display);
+	if (rc != EOK) {
+		printf("Error opening display.\n");
+		return rc;
+	}
+
+	rc = display_window_create(display, &window);
+	if (rc != EOK) {
+		printf("Error creating window.\n");
+		return rc;
+	}
+
+	rc = display_window_get_gc(window, &gc);
+	if (rc != EOK) {
+		printf("Error getting graphics context.\n");
+	}
+
+	rc = demo_rects(gc, 400, 300);
+	if (rc != EOK)
+		return rc;
+
+	rc = gfx_context_delete(gc);
+	if (rc != EOK)
+		return rc;
+
+	return EOK;
+}
+
 static void print_syntax(void)
 {
-	printf("syntax: gfxdemo {canvas|console}\n");
+	printf("syntax: gfxdemo {canvas|console|display}\n");
 }
 
@@ -202,4 +237,8 @@
 	} else if (str_cmp(argv[1], "canvas") == 0) {
 		rc = demo_canvas();
+		if (rc != EOK)
+			return 1;
+	} else if (str_cmp(argv[1], "display") == 0) {
+		rc = demo_display();
 		if (rc != EOK)
 			return 1;
Index: uspace/app/gfxdemo/meson.build
===================================================================
--- uspace/app/gfxdemo/meson.build	(revision aac506977cd4c2bd4f4d8d877a8e9b457321b790)
+++ uspace/app/gfxdemo/meson.build	(revision c8cf261a450bf22fa6cc6e9872a1f07f9e7dccda)
@@ -27,5 +27,5 @@
 #
 
-deps = [ 'gfx', 'guigfx', 'congfx', 'ipcgfx' ]
+deps = [ 'gfx', 'guigfx', 'congfx', 'ipcgfx', 'display' ]
 src = files(
 	'gfxdemo.c',
Index: uspace/lib/c/include/ipc/services.h
===================================================================
--- uspace/lib/c/include/ipc/services.h	(revision aac506977cd4c2bd4f4d8d877a8e9b457321b790)
+++ uspace/lib/c/include/ipc/services.h	(revision c8cf261a450bf22fa6cc6e9872a1f07f9e7dccda)
@@ -54,4 +54,5 @@
 #define SERVICE_NAME_CLIPBOARD "clipboard"
 #define SERVICE_NAME_CORECFG  "corecfg"
+#define SERVICE_NAME_DISPLAY  "hid/display"
 #define SERVICE_NAME_DHCP     "net/dhcp"
 #define SERVICE_NAME_DNSR     "net/dnsr"
Index: uspace/lib/display/doc/doxygroups.h
===================================================================
--- uspace/lib/display/doc/doxygroups.h	(revision c8cf261a450bf22fa6cc6e9872a1f07f9e7dccda)
+++ uspace/lib/display/doc/doxygroups.h	(revision c8cf261a450bf22fa6cc6e9872a1f07f9e7dccda)
@@ -0,0 +1,3 @@
+/** @addtogroup libdisplay libdisplay
+ * @ingroup libs
+ */
Index: uspace/lib/display/include/disp_srv.h
===================================================================
--- uspace/lib/display/include/disp_srv.h	(revision c8cf261a450bf22fa6cc6e9872a1f07f9e7dccda)
+++ uspace/lib/display/include/disp_srv.h	(revision c8cf261a450bf22fa6cc6e9872a1f07f9e7dccda)
@@ -0,0 +1,60 @@
+/*
+ * Copyright (c) 2012 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 libdisplay
+ * @{
+ */
+/** @file
+ */
+
+#ifndef _LIBDISPLAY_DISP_SRV_H_
+#define _LIBDISPLAY_DISP_SRV_H_
+
+#include <async.h>
+#include <errno.h>
+
+typedef struct display_ops display_ops_t;
+
+/** Display server structure (per client session) */
+typedef struct {
+	async_sess_t *client_sess;
+	display_ops_t *ops;
+	void *arg;
+} display_srv_t;
+
+struct display_ops {
+	errno_t (*window_create)(void *, sysarg_t *);
+	errno_t (*window_destroy)(void *, sysarg_t);
+};
+
+extern void display_conn(ipc_call_t *, display_srv_t *);
+
+#endif
+
+/** @}
+ */
Index: uspace/lib/display/include/display.h
===================================================================
--- uspace/lib/display/include/display.h	(revision c8cf261a450bf22fa6cc6e9872a1f07f9e7dccda)
+++ uspace/lib/display/include/display.h	(revision c8cf261a450bf22fa6cc6e9872a1f07f9e7dccda)
@@ -0,0 +1,52 @@
+/*
+ * Copyright (c) 2019 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 libdisplay
+ * @{
+ */
+/** @file
+ */
+
+#ifndef _LIBDISPLAY_DISPLAY_H_
+#define _LIBDISPLAY_DISPLAY_H_
+
+#include <errno.h>
+#include <gfx/context.h>
+#include <stdbool.h>
+#include "types/display.h"
+
+extern errno_t display_open(const char *, display_t **);
+extern void display_close(display_t *);
+extern errno_t display_window_create(display_t *, display_window_t **);
+extern errno_t display_window_destroy(display_window_t *);
+extern errno_t display_window_get_gc(display_window_t *, gfx_context_t **);
+
+#endif
+
+/** @}
+ */
Index: uspace/lib/display/include/ipc/display.h
===================================================================
--- uspace/lib/display/include/ipc/display.h	(revision c8cf261a450bf22fa6cc6e9872a1f07f9e7dccda)
+++ uspace/lib/display/include/ipc/display.h	(revision c8cf261a450bf22fa6cc6e9872a1f07f9e7dccda)
@@ -0,0 +1,49 @@
+/*
+ * Copyright (c) 2019 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 libcipc
+ * @{
+ */
+/** @file
+ */
+
+#ifndef _LIBC_IPC_DISPLAY_H_
+#define _LIBC_IPC_DISPLAY_H_
+
+#include <ipc/common.h>
+
+typedef enum {
+	DISPLAY_WINDOW_CREATE = IPC_FIRST_USER_METHOD,
+	DISPLAY_WINDOW_DESTROY,
+	DISPLAY_WINDOW_GC
+} display_request_t;
+
+#endif
+
+/** @}
+ */
Index: uspace/lib/display/include/types/display.h
===================================================================
--- uspace/lib/display/include/types/display.h	(revision c8cf261a450bf22fa6cc6e9872a1f07f9e7dccda)
+++ uspace/lib/display/include/types/display.h	(revision c8cf261a450bf22fa6cc6e9872a1f07f9e7dccda)
@@ -0,0 +1,59 @@
+/*
+ * Copyright (c) 2019 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 libc
+ * @{
+ */
+/** @file
+ */
+
+#ifndef _LIBDISPLAY_TYPES_DISPLAY_H_
+#define _LIBDISPLAY_TYPES_DISPLAY_H_
+
+#include <async.h>
+#include <ipc/devman.h>
+#include <stdint.h>
+
+/** Display server session */
+typedef struct {
+	/** Session with display server */
+	async_sess_t *sess;
+} display_t;
+
+/** Display window */
+typedef struct {
+	/** Display associated with the window */
+	display_t *display;
+	/** Window ID */
+	sysarg_t id;
+} display_window_t;
+
+#endif
+
+/** @}
+ */
Index: uspace/lib/display/meson.build
===================================================================
--- uspace/lib/display/meson.build	(revision c8cf261a450bf22fa6cc6e9872a1f07f9e7dccda)
+++ uspace/lib/display/meson.build	(revision c8cf261a450bf22fa6cc6e9872a1f07f9e7dccda)
@@ -0,0 +1,33 @@
+#
+# Copyright (c) 2019 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.
+#
+
+deps = [ 'gfx', 'ipcgfx' ]
+src = files(
+	'src/display.c',
+	'src/disp_srv.c'
+)
Index: uspace/lib/display/src/disp_srv.c
===================================================================
--- uspace/lib/display/src/disp_srv.c	(revision c8cf261a450bf22fa6cc6e9872a1f07f9e7dccda)
+++ uspace/lib/display/src/disp_srv.c	(revision c8cf261a450bf22fa6cc6e9872a1f07f9e7dccda)
@@ -0,0 +1,104 @@
+/*
+ * Copyright (c) 2019 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 libc
+ * @{
+ */
+/**
+ * @file
+ * @brief Display protocol server stub
+ */
+
+#include <disp_srv.h>
+#include <errno.h>
+#include <ipc/display.h>
+#include <stdlib.h>
+#include <stddef.h>
+
+static void display_window_create_srv(display_srv_t *srv, ipc_call_t *icall)
+{
+	sysarg_t wnd_id;
+	errno_t rc;
+
+	if (srv->ops->window_create == NULL) {
+		async_answer_0(icall, ENOTSUP);
+		return;
+	}
+
+	rc = srv->ops->window_create(srv->arg, &wnd_id);
+	async_answer_1(icall, rc, wnd_id);
+}
+
+static void display_window_destroy_srv(display_srv_t *srv, ipc_call_t *icall)
+{
+	sysarg_t wnd_id;
+	errno_t rc;
+
+	wnd_id = ipc_get_arg1(icall);
+
+	if (srv->ops->window_create == NULL) {
+		async_answer_0(icall, ENOTSUP);
+		return;
+	}
+
+	rc = srv->ops->window_destroy(srv->arg, wnd_id);
+	async_answer_0(icall, rc);
+}
+
+void display_conn(ipc_call_t *icall, display_srv_t *srv)
+{
+	/* Accept the connection */
+	async_accept_0(icall);
+
+	while (true) {
+		ipc_call_t call;
+
+		async_get_call(&call);
+		sysarg_t method = ipc_get_imethod(&call);
+
+		if (!method) {
+			/* The other side has hung up */
+			async_answer_0(&call, EOK);
+			break;
+		}
+
+		switch (method) {
+		case DISPLAY_WINDOW_CREATE:
+			display_window_create_srv(srv, &call);
+			break;
+		case DISPLAY_WINDOW_DESTROY:
+			display_window_destroy_srv(srv, &call);
+			break;
+		default:
+			async_answer_0(&call, ENOTSUP);
+		}
+	}
+}
+
+/** @}
+ */
Index: uspace/lib/display/src/display.c
===================================================================
--- uspace/lib/display/src/display.c	(revision c8cf261a450bf22fa6cc6e9872a1f07f9e7dccda)
+++ uspace/lib/display/src/display.c	(revision c8cf261a450bf22fa6cc6e9872a1f07f9e7dccda)
@@ -0,0 +1,169 @@
+/*
+ * Copyright (c) 2019 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 <async.h>
+#include <display.h>
+#include <errno.h>
+#include <ipc/display.h>
+#include <ipc/services.h>
+#include <ipcgfx/client.h>
+#include <loc.h>
+#include <stdlib.h>
+
+/** Open display service.
+ *
+ * @param dsname Display service name or @c NULL to use default display
+ * @param rdisplay Place to store pointer to display session
+ * @return EOK on success or an error code
+ */
+errno_t display_open(const char *dsname, display_t **rdisplay)
+{
+	service_id_t display_svc;
+	display_t *display;
+	errno_t rc;
+
+	display = calloc(1, sizeof(display_t));
+	if (display == NULL)
+		return ENOMEM;
+
+	if (dsname == NULL)
+		dsname = SERVICE_NAME_DISPLAY;
+
+	rc = loc_service_get_id(dsname, &display_svc, IPC_FLAG_BLOCKING);
+	if (rc != EOK) {
+		free(display);
+		return ENOENT;
+	}
+
+	display->sess = loc_service_connect(display_svc, INTERFACE_DISPLAY,
+	    IPC_FLAG_BLOCKING);
+	if (display->sess == NULL) {
+		free(display);
+		return ENOENT;
+	}
+
+	*rdisplay = display;
+	return EOK;
+}
+
+/** Close display service.
+ *
+ * @param display Display session
+ */
+void display_close(display_t *display)
+{
+	async_hangup(display->sess);
+	free(display);
+}
+
+/** Create a display window.
+ *
+ * @param display Display
+ * @param rwindow Place to store pointer to new window
+ * @return EOK on success or an error code
+ */
+errno_t display_window_create(display_t *display, display_window_t **rwindow)
+{
+	display_window_t *window;
+	async_exch_t *exch;
+	sysarg_t wnd_id;
+	errno_t rc;
+
+	window = calloc(1, sizeof(display_window_t));
+	if (window == NULL)
+		return ENOMEM;
+
+	exch = async_exchange_begin(display->sess);
+	rc = async_req_0_1(exch, DISPLAY_WINDOW_CREATE, &wnd_id);
+
+	async_exchange_end(exch);
+
+	if (rc != EOK) {
+		free(window);
+		return rc;
+	}
+
+	window->display = display;
+	window->id = wnd_id;
+	*rwindow = window;
+	return EOK;
+}
+
+/** Destroy display window.
+ *
+ * @param window Window
+ * @return EOK on success or an error code. In both cases @a window must
+ *         not be accessed anymore
+ */
+errno_t display_window_destroy(display_window_t *window)
+{
+	async_exch_t *exch;
+	errno_t rc;
+
+	exch = async_exchange_begin(window->display->sess);
+	rc = async_req_1_0(exch, DISPLAY_WINDOW_DESTROY, window->id);
+
+	async_exchange_end(exch);
+
+	free(window);
+	return rc;
+}
+
+/** Create graphics context for drawing into a window.
+ *
+ * @param window Window
+ * @param rgc Place to store pointer to new graphics context
+ */
+errno_t display_window_get_gc(display_window_t *window, gfx_context_t **rgc)
+{
+	async_sess_t *sess;
+	async_exch_t *exch;
+	ipc_gc_t *gc;
+	errno_t rc;
+
+	exch = async_exchange_begin(window->display->sess);
+	sess = async_connect_me_to(exch, INTERFACE_GC, 0, window->id);
+	if (sess == NULL) {
+		async_exchange_end(exch);
+		return EIO;
+	}
+
+	async_exchange_end(exch);
+
+	rc = ipc_gc_create(sess, &gc);
+	if (rc != EOK) {
+		async_hangup(sess);
+		return ENOMEM;
+	}
+
+	*rgc = ipc_gc_get_ctx(gc);
+	return EOK;
+}
+
+/** @}
+ */
Index: uspace/lib/ipcgfx/include/ipcgfx/server.h
===================================================================
--- uspace/lib/ipcgfx/include/ipcgfx/server.h	(revision aac506977cd4c2bd4f4d8d877a8e9b457321b790)
+++ uspace/lib/ipcgfx/include/ipcgfx/server.h	(revision c8cf261a450bf22fa6cc6e9872a1f07f9e7dccda)
@@ -41,5 +41,5 @@
 #include <gfx/context.h>
 
-extern errno_t gc_conn(ipc_call_t *icall, gfx_context_t *gc)
+extern errno_t gc_conn(ipc_call_t *icall, gfx_context_t *gc);
 
 #endif
Index: uspace/lib/ipcgfx/src/client.c
===================================================================
--- uspace/lib/ipcgfx/src/client.c	(revision aac506977cd4c2bd4f4d8d877a8e9b457321b790)
+++ uspace/lib/ipcgfx/src/client.c	(revision c8cf261a450bf22fa6cc6e9872a1f07f9e7dccda)
@@ -51,4 +51,6 @@
 };
 
+#include <stdio.h>
+
 /** Set color on IPC GC.
  *
@@ -67,4 +69,5 @@
 	errno_t rc;
 
+	printf("ipc_gc_set_color\n");
 	gfx_color_get_rgb_i16(color, &r, &g, &b);
 
@@ -89,4 +92,5 @@
 	errno_t rc;
 
+	printf("ipc_gc_fill_rect\n");
 	exch = async_exchange_begin(ipcgc->sess);
 	rc = async_req_4_0(exch, GC_FILL_RECT, rect->p0.x, rect->p0.y,
Index: uspace/lib/ipcgfx/src/server.c
===================================================================
--- uspace/lib/ipcgfx/src/server.c	(revision aac506977cd4c2bd4f4d8d877a8e9b457321b790)
+++ uspace/lib/ipcgfx/src/server.c	(revision c8cf261a450bf22fa6cc6e9872a1f07f9e7dccda)
@@ -44,4 +44,6 @@
 #include <stdint.h>
 
+#include <stdio.h>
+
 #include <bd_srv.h>
 
@@ -64,4 +66,5 @@
 	rc = gfx_set_color(gc, color);
 	async_answer_0(call, rc);
+	printf("done with rgb_color_srv\n");
 }
 
@@ -85,4 +88,6 @@
 	async_accept_0(icall);
 
+	printf("gc_conn: accepted connection\n");
+
 	while (true) {
 		ipc_call_t call;
@@ -98,11 +103,17 @@
 		switch (method) {
 		case GC_SET_RGB_COLOR:
+			printf("gc_conn: set_rgb_color\n");
 			gc_set_rgb_color_srv(gc, &call);
+			printf("gc_conn: done set_rgb_color\n");
 			break;
 		case GC_FILL_RECT:
+			printf("gc_conn: fill_rect_srv\n");
 			gc_fill_rect_srv(gc, &call);
+			printf("gc_conn: done fill_rect_srv\n");
 			break;
 		default:
+			printf("gc_conn: answer einval\n");
 			async_answer_0(&call, EINVAL);
+			printf("gc_conn: done answer einval\n");
 		}
 	}
Index: uspace/lib/meson.build
===================================================================
--- uspace/lib/meson.build	(revision aac506977cd4c2bd4f4d8d877a8e9b457321b790)
+++ uspace/lib/meson.build	(revision c8cf261a450bf22fa6cc6e9872a1f07f9e7dccda)
@@ -86,5 +86,7 @@
 	'guigfx',
 	'ieee80211',
-	'ipcgfx'
+	'ipcgfx',
+
+	'display'
 ]
 
Index: uspace/srv/hid/display/display.c
===================================================================
--- uspace/srv/hid/display/display.c	(revision c8cf261a450bf22fa6cc6e9872a1f07f9e7dccda)
+++ uspace/srv/hid/display/display.c	(revision c8cf261a450bf22fa6cc6e9872a1f07f9e7dccda)
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2019 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 display
+ * @{
+ */
+/**
+ * @file Display management
+ */
+
+#include <disp_srv.h>
+#include <errno.h>
+#include <io/log.h>
+
+static errno_t disp_window_create(void *, sysarg_t *);
+static errno_t disp_window_destroy(void *, sysarg_t);
+
+display_ops_t display_srv_ops = {
+	.window_create = disp_window_create,
+	.window_destroy = disp_window_destroy
+};
+
+static errno_t disp_window_create(void *arg, sysarg_t *rwnd_id)
+{
+	log_msg(LOG_DEFAULT, LVL_DEBUG, "disp_window_create()");
+	*rwnd_id = 42;
+	return EOK;
+}
+
+static errno_t disp_window_destroy(void *arg, sysarg_t wnd_id)
+{
+	log_msg(LOG_DEFAULT, LVL_DEBUG, "disp_window_destroy()");
+	return EOK;
+}
+
+/** @}
+ */
Index: uspace/srv/hid/display/display.h
===================================================================
--- uspace/srv/hid/display/display.h	(revision c8cf261a450bf22fa6cc6e9872a1f07f9e7dccda)
+++ uspace/srv/hid/display/display.h	(revision c8cf261a450bf22fa6cc6e9872a1f07f9e7dccda)
@@ -0,0 +1,47 @@
+/*
+ * Copyright (c) 2019 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 inet
+ * @{
+ */
+/**
+ * @file
+ * @brief
+ */
+
+#ifndef DISPLAY_H
+#define DISPLAY_H
+
+#include <disp_srv.h>
+
+extern display_ops_t display_srv_ops;
+
+#endif
+
+/** @}
+ */
Index: uspace/srv/hid/display/doc/doxygroups.h
===================================================================
--- uspace/srv/hid/display/doc/doxygroups.h	(revision c8cf261a450bf22fa6cc6e9872a1f07f9e7dccda)
+++ uspace/srv/hid/display/doc/doxygroups.h	(revision c8cf261a450bf22fa6cc6e9872a1f07f9e7dccda)
@@ -0,0 +1,4 @@
+/** @addtogroup display display
+ * @ingroup srvs
+ * @brief Display server
+ */
Index: uspace/srv/hid/display/main.c
===================================================================
--- uspace/srv/hid/display/main.c	(revision c8cf261a450bf22fa6cc6e9872a1f07f9e7dccda)
+++ uspace/srv/hid/display/main.c	(revision c8cf261a450bf22fa6cc6e9872a1f07f9e7dccda)
@@ -0,0 +1,147 @@
+/*
+ * Copyright (c) 2019 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 display
+ * @{
+ */
+/**
+ * @file Display server main
+ */
+
+#include <async.h>
+#include <disp_srv.h>
+#include <errno.h>
+#include <gfx/context.h>
+#include <str_error.h>
+#include <io/log.h>
+#include <ipc/services.h>
+#include <ipcgfx/server.h>
+#include <loc.h>
+#include <stdio.h>
+#include <task.h>
+#include "display.h"
+#include "wingc.h"
+
+#define NAME  "display"
+
+static void display_client_conn(ipc_call_t *, void *);
+
+/** Initialize display server */
+static errno_t display_srv_init(void)
+{
+	errno_t rc;
+
+	log_msg(LOG_DEFAULT, LVL_DEBUG, "display_srv_init()");
+
+	async_set_fallback_port_handler(display_client_conn, NULL/*parts*/);
+
+	rc = loc_server_register(NAME);
+	if (rc != EOK) {
+		log_msg(LOG_DEFAULT, LVL_ERROR, "Failed registering server: %s.", str_error(rc));
+		rc = EEXIST;
+	}
+
+	service_id_t sid;
+	rc = loc_service_register(SERVICE_NAME_DISPLAY, &sid);
+	if (rc != EOK) {
+		log_msg(LOG_DEFAULT, LVL_ERROR, "Failed registering service: %s.", str_error(rc));
+		rc = EEXIST;
+		goto error;
+	}
+
+	return EOK;
+error:
+	return rc;
+}
+
+/** Handle client connection to display server */
+static void display_client_conn(ipc_call_t *icall, void *arg)
+{
+	display_srv_t srv;
+	sysarg_t wnd_id;
+	sysarg_t svc_id;
+	win_gc_t *wgc = NULL;
+	gfx_context_t *gc;
+	errno_t rc;
+
+	log_msg(LOG_DEFAULT, LVL_NOTE, "display_client_conn arg1=%zu arg2=%zu arg3=%zu arg4=%zu.",
+	    ipc_get_arg1(icall), ipc_get_arg2(icall), ipc_get_arg3(icall),
+	    ipc_get_arg4(icall));
+
+	(void) icall;
+	(void) arg;
+
+	svc_id = ipc_get_arg2(icall);
+	wnd_id = ipc_get_arg3(icall);
+
+	if (svc_id != 0) {
+		/* Display management */
+		srv.ops = &display_srv_ops;
+		srv.arg = NULL;
+
+		display_conn(icall, &srv);
+	} else {
+		(void) wnd_id;
+		/* Window GC */
+		rc = win_gc_create(&wgc);
+		if (rc != EOK) {
+			async_answer_0(icall, ENOMEM);
+			return;
+		}
+
+		gc = win_gc_get_ctx(wgc);
+		gc_conn(icall, gc);
+
+		win_gc_delete(wgc);
+	}
+}
+
+int main(int argc, char *argv[])
+{
+	errno_t rc;
+
+	printf("%s: Display server\n", NAME);
+
+	if (log_init(NAME) != EOK) {
+		printf(NAME ": Failed to initialize logging.\n");
+		return 1;
+	}
+
+	rc = display_srv_init();
+	if (rc != EOK)
+		return 1;
+
+	printf(NAME ": Accepting connections.\n");
+	task_retval(0);
+	async_manager();
+
+	return 0;
+}
+
+/** @}
+ */
Index: uspace/srv/hid/display/meson.build
===================================================================
--- uspace/srv/hid/display/meson.build	(revision c8cf261a450bf22fa6cc6e9872a1f07f9e7dccda)
+++ uspace/srv/hid/display/meson.build	(revision c8cf261a450bf22fa6cc6e9872a1f07f9e7dccda)
@@ -0,0 +1,35 @@
+#
+# Copyright (c) 2019 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.
+#
+
+deps = [ 'ipcgfx', 'display' ]
+
+src = files(
+	'display.c',
+	'main.c',
+	'wingc.c'
+)
Index: uspace/srv/hid/display/types/wingc.h
===================================================================
--- uspace/srv/hid/display/types/wingc.h	(revision c8cf261a450bf22fa6cc6e9872a1f07f9e7dccda)
+++ uspace/srv/hid/display/types/wingc.h	(revision c8cf261a450bf22fa6cc6e9872a1f07f9e7dccda)
@@ -0,0 +1,49 @@
+/*
+ * Copyright (c) 2019 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 libipcgfx
+ * @{
+ */
+/**
+ * @file GFX IPC backend
+ */
+
+#ifndef TYPES_WINGC_H
+#define TYPES_WINGC_H
+
+#include <gfx/context.h>
+
+typedef struct win_gc {
+	/** Base graphic context */
+	gfx_context_t *gc;
+} win_gc_t;
+
+#endif
+
+/** @}
+ */
Index: uspace/srv/hid/display/wingc.c
===================================================================
--- uspace/srv/hid/display/wingc.c	(revision c8cf261a450bf22fa6cc6e9872a1f07f9e7dccda)
+++ uspace/srv/hid/display/wingc.c	(revision c8cf261a450bf22fa6cc6e9872a1f07f9e7dccda)
@@ -0,0 +1,148 @@
+/*
+ * Copyright (c) 2019 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 display
+ * @{
+ */
+/**
+ * @file GFX window backend
+ *
+ * This implements a graphics context over display server window.
+ */
+
+#include <gfx/color.h>
+#include <gfx/context.h>
+#include <gfx/render.h>
+#include <io/log.h>
+#include <stdlib.h>
+#include "wingc.h"
+
+static errno_t win_gc_set_color(void *, gfx_color_t *);
+static errno_t win_gc_fill_rect(void *, gfx_rect_t *);
+
+gfx_context_ops_t win_gc_ops = {
+	.set_color = win_gc_set_color,
+	.fill_rect = win_gc_fill_rect
+};
+
+/** Set color on window GC.
+ *
+ * Set drawing color on window GC.
+ *
+ * @param arg Console GC
+ * @param color Color
+ *
+ * @return EOK on success or an error code
+ */
+static errno_t win_gc_set_color(void *arg, gfx_color_t *color)
+{
+	win_gc_t *wgc = (win_gc_t *) arg;
+
+	(void) wgc;
+	log_msg(LOG_DEFAULT, LVL_NOTE, "gc_set_color");
+	return EOK;
+}
+
+/** Fill rectangle on window GC.
+ *
+ * @param arg Console GC
+ * @param rect Rectangle
+ *
+ * @return EOK on success or an error code
+ */
+static errno_t win_gc_fill_rect(void *arg, gfx_rect_t *rect)
+{
+	win_gc_t *wgc = (win_gc_t *) arg;
+
+	(void) wgc;
+	log_msg(LOG_DEFAULT, LVL_NOTE, "gc_fill_rect");
+	return EOK;
+}
+
+/** Create window GC.
+ *
+ * Create graphics context for rendering into a window.
+ *
+ * @param rgc Place to store pointer to new GC.
+ *
+ * @return EOK on success or an error code
+ */
+errno_t win_gc_create(win_gc_t **rgc)
+{
+	win_gc_t *wgc = NULL;
+	gfx_context_t *gc = NULL;
+	errno_t rc;
+
+	wgc = calloc(1, sizeof(win_gc_t));
+	if (wgc == NULL) {
+		rc = ENOMEM;
+		goto error;
+	}
+
+	rc = gfx_context_new(&win_gc_ops, wgc, &gc);
+	if (rc != EOK)
+		goto error;
+
+	wgc->gc = gc;
+	*rgc = wgc;
+	return EOK;
+error:
+	if (wgc != NULL)
+		free(wgc);
+	gfx_context_delete(gc);
+	return rc;
+}
+
+/** Delete window GC.
+ *
+ * @param wgc Console GC
+ */
+errno_t win_gc_delete(win_gc_t *wgc)
+{
+	errno_t rc;
+
+	rc = gfx_context_delete(wgc->gc);
+	if (rc != EOK)
+		return rc;
+
+	free(wgc);
+	return EOK;
+}
+
+/** Get generic graphic context from window GC.
+ *
+ * @param wgc Console GC
+ * @return Graphic context
+ */
+gfx_context_t *win_gc_get_ctx(win_gc_t *wgc)
+{
+	return wgc->gc;
+}
+
+/** @}
+ */
Index: uspace/srv/hid/display/wingc.h
===================================================================
--- uspace/srv/hid/display/wingc.h	(revision c8cf261a450bf22fa6cc6e9872a1f07f9e7dccda)
+++ uspace/srv/hid/display/wingc.h	(revision c8cf261a450bf22fa6cc6e9872a1f07f9e7dccda)
@@ -0,0 +1,52 @@
+/*
+ * Copyright (c) 2019 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 display
+ * @{
+ */
+/**
+ * @file Window graphics context
+ */
+
+#ifndef WINGC_H
+#define WINGC_H
+
+#include <types/gfx/context.h>
+#include <types/gfx/ops/context.h>
+#include "types/wingc.h"
+
+extern gfx_context_ops_t win_gc_ops;
+
+extern errno_t win_gc_create(win_gc_t **);
+extern errno_t win_gc_delete(win_gc_t *);
+extern gfx_context_t *win_gc_get_ctx(win_gc_t *);
+
+#endif
+
+/** @}
+ */
Index: uspace/srv/meson.build
===================================================================
--- uspace/srv/meson.build	(revision aac506977cd4c2bd4f4d8d877a8e9b457321b790)
+++ uspace/srv/meson.build	(revision c8cf261a450bf22fa6cc6e9872a1f07f9e7dccda)
@@ -45,4 +45,5 @@
 	'hid/compositor',
 	'hid/console',
+	'hid/display',
 	'hid/input',
 	'hid/isdv4_tablet',
