aboutsummaryrefslogtreecommitdiff
path: root/src/drmmode_pl111/drmmode_pl111.c
diff options
context:
space:
mode:
authorJavier Martin <javier.martin@arm.com>2013-09-16 15:22:41 +0100
committerJavier Martin <javier.martin@arm.com>2013-09-16 16:46:54 +0100
commita7e316f75ca12d8f235ca36714009dfbe6762fda (patch)
treeaa7a2db7683ddcf2c1e80ac298b9ee2d25ae58f6 /src/drmmode_pl111/drmmode_pl111.c
parent8e9ac7bda78e62b375bcafdd7f44fa2d2175b71e (diff)
Remove ARGB to LBBP format conversion for pl111.
The pl111 DRM driver now exposes ARGB to user space for the HW cursor. This is according to what other DRM drivers are doing for HW cursor support. As a result we no longer need a custom callback for setting the cursor image. Change-Id: I9af6268f39cd7b1e22240326b09bed54af4fe5ae
Diffstat (limited to 'src/drmmode_pl111/drmmode_pl111.c')
-rw-r--r--src/drmmode_pl111/drmmode_pl111.c97
1 files changed, 0 insertions, 97 deletions
diff --git a/src/drmmode_pl111/drmmode_pl111.c b/src/drmmode_pl111/drmmode_pl111.c
index 34f1d8c..3b9f92f 100644
--- a/src/drmmode_pl111/drmmode_pl111.c
+++ b/src/drmmode_pl111/drmmode_pl111.c
@@ -37,105 +37,9 @@
/* Padding added down each side of cursor image */
#define CURSORPAD (0)
-/* un-comment to enable cursor format conversion debugging.*/
-/* #define ARGB_LBBP_CONVERSION_DEBUG */
-
-#define LBBP_BACKGROUND (0x0)
-#define LBBP_FOREGROUND (0x1)
-#define LBBP_TRANSPARENT (0x2)
-#define LBBP_INVERSE (0x3)
-
-#define ARGB_ALPHA (0xff000000)
-#define ARGB_RGB (~ARGB_ALPHA)
-
-#define LBBP_WORDS_PER_LINE (4)
-#define LBBP_PIXELS_PER_WORD (16)
-
#define PL111_SCANOUT_FLAGS 0x00000001
#define PL111_NON_SCANOUT_FLAGS 0x00000000
-/* shift required to locate pixel into the correct position in
- * a cursor LBBP word, indexed by x mod 16.
- */
-const unsigned char x_mod_16_to_value_shift[LBBP_PIXELS_PER_WORD] = {
- 6, 4, 2, 0, 14, 12, 10, 8, 22, 20, 18, 16, 30, 28, 26, 24
-};
-
-/* Pack the pixel value into its correct position in the buffer as specified
- * for LBBP */
-static inline void
-set_lbbp_pixel(uint32_t *buffer, unsigned int x, unsigned int y,
- uint32_t value)
-{
- uint32_t *p;
- uint32_t shift;
-
- assert((x < CURSORW) && (y < CURSORH));
-
- shift = x_mod_16_to_value_shift[x % LBBP_PIXELS_PER_WORD];
-
- /* Get the word containing this pixel */
- p = buffer + (x >> LBBP_WORDS_PER_LINE) + (y << 2);
-
- /* Clear data for this pixel in the buffer and apply the new data */
- *p &= ~(LBBP_INVERSE << shift);
- *p |= value << shift;
-}
-
-/*
- * The PL111 hardware cursor supports only LBBP which is a 2bpp format but
- * there are no drm fourcc formats that are compatible with this so instead
- * the PL111 DRM reports (to DRM core) that it supports only
- * DRM_FORMAT_ARGB8888 and expects the DDX to supply an LBPP image in the
- * first 1/16th of the buffer, the rest being unused.
- * Ideally we would want to receive the image in this format from X, but
- * currently the X cursor image is 32bpp ARGB so we need to convert
- * to LBBP here.
- */
-static void set_cursor_image(xf86CrtcPtr crtc, uint32_t *d, CARD32 *s)
-{
-#ifdef ARGB_LBBP_CONVERSION_DEBUG
- /* Add 1 on width to insert trailing NULL */
- char string_cursor[CURSORW+1];
-#endif /* ARGB_LBBP_CONVERSION_DEBUG */
- unsigned int x;
- unsigned int y;
-
- for (y = 0; y < CURSORH ; y++) {
- for (x = 0; x < CURSORW ; x++) {
- uint32_t value = LBBP_TRANSPARENT;
- /* If pixel visible foreground/background */
- if ((*s & ARGB_ALPHA) != 0) {
- /* Any color set then just convert to
- * foreground for now
- */
- if ((*s & ARGB_RGB) != 0)
- value = LBBP_FOREGROUND;
- else
- value = LBBP_BACKGROUND;
- }
-#ifdef ARGB_LBBP_CONVERSION_DEBUG
- if (value == LBBP_TRANSPARENT)
- string_cursor[x] = 'T';
- else if (value == LBBP_FOREGROUND)
- string_cursor[x] = 'F';
- else if (value == LBBP_INVERSE)
- string_cursor[x] = 'I';
- else
- string_cursor[x] = 'B';
-
-#endif /* ARGB_LBBP_CONVERSION_DEBUG */
- set_lbbp_pixel(d, x, y, value);
- ++s;
- }
-#ifdef ARGB_LBBP_CONVERSION_DEBUG
- string_cursor[CURSORW] = '\0';
- xf86DrvMsg(crtc->scrn->scrnIndex, X_INFO, "%s\n",
- string_cursor);
-#endif /* ARGB_LBBP_CONVERSION_DEBUG */
- }
-}
-
/* TODO MIDEGL-1718: this should be included
* from kernel headers when pl111 is mainline */
struct drm_pl111_gem_create {
@@ -193,7 +97,6 @@ struct drmmode_interface pl111_interface = {
CURSORPAD /* cursor padding */,
HWCURSOR_API_STANDARD /* cursor_api */,
NULL /* init_plane_for_cursor */,
- set_cursor_image /* set cursor image */,
0 /* vblank_query_supported */,
create_custom_gem /* create_custom_gem */,
};