On Tue, Dec 27, 2016 at 11:39:26PM +0100, Frederic Cambus wrote:
> 
> > > Here is a diff with some tweaks for smfb(4):
> > > 
> > > - Display resolution and color depth when attaching
> > 
> > We should try to do so in a uniform way though.  None of our drivers
> > print the words "frame buffer".  Most of them only print the
> > resolution, but I can see the additional value of printing the depth
> > as well.  Perhaps we should do that for the other framebuffers as well.
> 
> All other frame buffer drivers on Loongson (radeonfb and sisfb) print
> it this way, that's why I used the same scheme here. It seems sgi
> drivers also do it this way.
> 
> I'm all for trying to do things in an uniform way though, and find the
> formatting used by efifb(4) possibly better: ": %dx%d, %dbpp\n". Any
> thoughts on this?

Following up on this, here is a revised version of the diff, which only
keeps the part adding resolution and color depth display when attaching.

The output has been updated to follow the efifb(4) scheme.

Comments? OK?

Index: sys/arch/loongson/dev/smfb.c
===================================================================
RCS file: /cvs/src/sys/arch/loongson/dev/smfb.c,v
retrieving revision 1.16
diff -u -p -r1.16 smfb.c
--- sys/arch/loongson/dev/smfb.c        21 Oct 2013 10:36:14 -0000      1.16
+++ sys/arch/loongson/dev/smfb.c        9 Jan 2017 15:29:54 -0000
@@ -202,6 +202,7 @@ void
 smfb_attach_common(struct smfb_softc *sc, int is5xx, bus_space_tag_t memt,
     bus_space_handle_t memh, bus_space_tag_t mmiot, bus_space_handle_t mmioh)
 {
+       struct smfb *fb;
        struct wsemuldisplaydev_attach_args waa;
        int console;
 
@@ -219,8 +220,9 @@ smfb_attach_common(struct smfb_softc *sc
                }
        }
 
-       /* XXX print resolution */
-       printf("\n");
+       fb = sc->sc_fb;
+       printf(": %dx%d, %dbpp\n",
+           fb->ri.ri_width, fb->ri.ri_height, fb->ri.ri_depth);
 
        sc->sc_scrlist[0] = &sc->sc_fb->wsd;
        sc->sc_wsl.nscreens = 1;

Reply via email to