Index | Thread | Search

From:
Jonathan Gray <jsg@jsg.id.au>
Subject:
Re: radeondrm: use the common KMS console path on sparc64
To:
tbullock@comlore.com
Cc:
tech@openbsd.org
Date:
Fri, 9 Oct 2026 12:37:29 +1100

Download raw body.

Thread
On Tue, Oct 06, 2026 at 12:04:39AM -0600, tbullock@comlore.com wrote:
> Hello,
> 
> I'm revisiting an old problem with the XVR100 on Sun Blade and other Sun
> systems. The card uses the Radeon RV100, and its support in OpenBSD has a
> variety of problems. I've decided to work through them systematically,
> one fix at a time.
> 
> The current console implementation is completely broken as it stands on
> the XVR100. Fixing the console is what's needed first. I'm going to try
> to remove as much of the sparc64 specific code as possible. Doing that
> already helps a lot, since the console becomes readable, although the
> console text is still blurred. The small byte order fix included in this
> patch corrects the colours to show a white background with black text.
> 
> Here is the first patch in that process. I've built and tested it on my
> Sun Blade 100 with an XVR100, and I recommend accepting this patch as
> tested. There are still further problems to work through.

This results in two calls to rasops_init() as fbwscons_init()
also calls rasops_init().  And the fbwscons_init() call already
sets RI_BSWAP.  So if nothing else this seems incomplete.

> 
> Ted
> 
> Diff against src 9a41316fee4f8507967e487ca8ed12429c06d449:
> 
> diff /usr/src
> path + /usr/src
> commit - 9a41316fee4f8507967e487ca8ed12429c06d449
> blob - 3490c1675a5465ca6e0a0cf331f9c4d812658394
> file + sys/dev/pci/drm/radeon/radeon_drv.c
> --- sys/dev/pci/drm/radeon/radeon_drv.c
> +++ sys/dev/pci/drm/radeon/radeon_drv.c
> @@ -743,9 +743,6 @@ int radeondrm_show_screen(void *, void *, int,
>      void (*)(void *, int, int), void *);
>  void radeondrm_doswitch(void *);
>  void radeondrm_enter_ddb(void *, void *);
> -#ifdef __sparc64__
> -void radeondrm_setcolor(void *, u_int, u_int8_t, u_int8_t, u_int8_t);
> -#endif
>  void radeondrm_setpal(struct radeon_device *, struct rasops_info *);
>  
>  struct wsscreen_descr radeondrm_stdscreen = {
> @@ -864,11 +861,7 @@ radeondrm_doswitch(void *v)
>  	struct radeon_device *rdev = ri->ri_hw;
>  
>  	rasops_show_screen(ri, rdev->switchcookie, 0, NULL, NULL);
> -#ifdef __sparc64__
> -	fbwscons_setcolormap(&rdev->sf, radeondrm_setcolor);
> -#else
>  	radeondrm_setpal(rdev, ri);
> -#endif
>  	drm_fb_helper_restore_fbdev_mode_unlocked(rdev_to_drm(rdev)->fb_helper,
>  	    false);
>  
> @@ -890,26 +883,7 @@ radeondrm_enter_ddb(void *v, void *cookie)
>  	drm_fb_helper_debug_enter(fb_helper->info);
>  }
>  
> -#ifdef __sparc64__
>  void
> -radeondrm_setcolor(void *v, u_int index, u_int8_t r, u_int8_t g, u_int8_t b)
> -{
> -	struct sunfb *sf = v;
> -	struct radeon_device *rdev = sf->sf_ro.ri_hw;
> -
> -	/* see legacy_crtc_load_lut() */
> -	if (rdev->family < CHIP_RS600) {
> -		WREG8(RADEON_PALETTE_INDEX, index);
> -		WREG32(RADEON_PALETTE_30_DATA,
> -		    (r << 22) | (g << 12) | (b << 2));
> -	} else {
> -		printf("%s: setcolor family %d not handled\n",
> -		    rdev->self.dv_xname, rdev->family);
> -	}
> -}
> -#endif
> -
> -void
>  radeondrm_setpal(struct radeon_device *rdev, struct rasops_info *ri)
>  {
>  	struct drm_device *dev = rdev_to_drm(rdev);
> @@ -1287,16 +1261,14 @@ radeondrm_attachhook(struct device *self)
>  	if (ri->ri_bits == NULL)
>  		return;
>  
> -#ifdef __sparc64__
> -	fbwscons_setcolormap(&rdev->sf, radeondrm_setcolor);
> -	ri = &rdev->sf.sf_ro;
> -#else
>  	radeondrm_setpal(rdev, ri);
>  	ri->ri_flg = RI_CENTER | RI_VCONS | RI_WRONLY;
> +#ifdef __sparc64__
> +	ri->ri_flg |= RI_BSWAP;
> +#endif
>  	rasops_init(ri, 160, 160);
>  
>  	ri->ri_hw = rdev;
> -#endif
>  
>  	radeondrm_stdscreen.capabilities = ri->ri_caps;
>  	radeondrm_stdscreen.nrows = ri->ri_rows;
> 
>