Looking up glyph shapes with a signed char in drm_draw_get_char_bitmap()
is unsafe. It also does not support extended ASCII codes with values
larger than 127.

Add the new function font_data_glyph_buf() to the font-data helpers. It
looks up the correct glyph from font data or returns NULL if no such
glyph exists. Convert DRM's log and panic code to the new function. Also
cast the character code to support all 256 ASCII characters.

Tested with drm_log on bochs.

Thomas Zimmermann (4):
  lib/fonts: Look up glyph data with font_data_glyph_buf()
  drm/client: log: Look up glyph shape with font helper
  drm/panic: Look up glyph shape with font helper
  drm/draw: Remove unused helper drm_draw_get_char_bitmap()

 drivers/gpu/drm/clients/drm_log.c   | 10 ++++++----
 drivers/gpu/drm/drm_draw_internal.h |  7 -------
 drivers/gpu/drm/drm_panic.c         |  6 ++++--
 include/linux/font.h                |  3 +++
 lib/fonts/fonts.c                   | 31 +++++++++++++++++++++++++++++
 5 files changed, 44 insertions(+), 13 deletions(-)

-- 
2.54.0

Reply via email to