16-bit depth on radeonfb
[email protected] Wed, 29 Jul 2026 08:46:51 +0200
| Newsgroups | gmane.os.netbsd.devel.kernel |
|---|---|
| Message-ID | <ammh29EZZQRU6q8x@localhost> |
Inspired by:
On Tue, Jul 28, 2026 at 02:23:29PM +0200, Edgar Fuß wrote:
> I find nothing wrong with proposing a patch, finding out that nobody else
> finds it useful and so keeping it local. /Not/ proposing it prevents others
> from finding it useful and the patch getting incorporated.
16-bit depth makes hardware with limited memory and/or memory bandwidth
much more usable and useful. The following patch adds this to radeonfb.
--- ./dev/pci/radeonfb.c.orig
+++ ./dev/pci/radeonfb.c
@@ -104,7 +104,8 @@
#ifdef RADEONFB_DEPTH_32
#define RADEONFB_DEFAULT_DEPTH 32
#else
-#define RADEONFB_DEFAULT_DEPTH 8
+/* #define RADEONFB_DEFAULT_DEPTH 8 */
+#define RADEONFB_DEFAULT_DEPTH 16
#endif
static int radeonfb_match(device_t, cfdata_t, void *);
@@ -214,7 +215,7 @@
#ifndef RADEON_DEFAULT_MODE
/* any reasonably modern display should handle this */
-#define RADEON_DEFAULT_MODE "1024x768x60"
+#define RADEON_DEFAULT_MODE "1024x768x60" /* to use when edid fails */
#endif
extern const u_char rasops_cmap[768];
@@ -897,6 +898,9 @@
case 8:
dp->rd_format = 2;
break;
+ case 16:
+ dp->rd_format = 4;
+ break;
case 32:
dp->rd_format = 6;
break;
@@ -2379,7 +2383,7 @@
/*
* CRTC_GEN_CNTL - depth, accelerator mode, etc.
*/
- /* only bother with 32bpp and 8bpp */
+ /* only bother with 32bpp, 16bpp, 8bpp */
v = dp->rd_format << RADEON_CRTC_PIX_WIDTH_SHIFT;
if (crtc == 1) {
Cheers
/od2uvb