vt: redefine world of cursor macros
The cursor code used to use magic constants, ANDs, ORs, and some macros. Redefine all this to make some sense. In particular: * Drop CUR_DEFAULT, which is CUR_UNDERLINE. CUR_DEFAULT was used only for cur_default variable initialization, so use CUR_UNDERLINE there to make obvious what's the default. * Drop CUR_HWMASK. Instead, define CUR_SIZE() which explains it more. And use it all over the places. * Define few more masks and bits which will be used in next patches instead of magic constants. * Define CUR_MAKE to build up cursor value. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Cc: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> Cc: dri-devel@lists.freedesktop.org Cc: linux-fbdev@vger.kernel.org Link: https://lore.kernel.org/r/20200615074910.19267-25-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:

committed by
Greg Kroah-Hartman

parent
dc219db66a
commit
4dfa3c54f9
@@ -173,17 +173,23 @@ struct vc {
|
||||
extern struct vc vc_cons [MAX_NR_CONSOLES];
|
||||
extern void vc_SAK(struct work_struct *work);
|
||||
|
||||
#define CUR_DEF 0
|
||||
#define CUR_NONE 1
|
||||
#define CUR_UNDERLINE 2
|
||||
#define CUR_LOWER_THIRD 3
|
||||
#define CUR_LOWER_HALF 4
|
||||
#define CUR_TWO_THIRDS 5
|
||||
#define CUR_BLOCK 6
|
||||
#define CUR_HWMASK 0x0f
|
||||
#define CUR_SWMASK 0xfff0
|
||||
|
||||
#define CUR_DEFAULT CUR_UNDERLINE
|
||||
#define CUR_MAKE(size, change, set) ((size) | ((change) << 8) | \
|
||||
((set) << 16))
|
||||
#define CUR_SIZE(c) ((c) & 0x00000f)
|
||||
# define CUR_DEF 0
|
||||
# define CUR_NONE 1
|
||||
# define CUR_UNDERLINE 2
|
||||
# define CUR_LOWER_THIRD 3
|
||||
# define CUR_LOWER_HALF 4
|
||||
# define CUR_TWO_THIRDS 5
|
||||
# define CUR_BLOCK 6
|
||||
#define CUR_SW 0x000010
|
||||
#define CUR_ALWAYS_BG 0x000020
|
||||
#define CUR_INVERT_FG_BG 0x000040
|
||||
#define CUR_FG 0x000700
|
||||
#define CUR_BG 0x007000
|
||||
#define CUR_CHANGE(c) ((c) & 0x00ff00)
|
||||
#define CUR_SET(c) (((c) & 0xff0000) >> 8)
|
||||
|
||||
bool con_is_visible(const struct vc_data *vc);
|
||||
|
||||
|
Reference in New Issue
Block a user