View | Details | Raw Unified | Return to bug 216123 | Differences between
and this patch

Collapse All | Expand All

(-)sys/dev/vt/hw/ofwfb/ofwfb.c (-8 / +8 lines)
Lines 280-285 Link Here
280
ofwfb_initialize(struct vt_device *vd)
282
ofwfb_initialize(struct vt_device *vd)
281
{
283
{
282
	struct ofwfb_softc *sc = vd->vd_softc;
284
	struct ofwfb_softc *sc = vd->vd_softc;
285
	char name[64];
286
	ihandle_t ih;
283
	int i, err;
287
	int i, err;
284
	cell_t retval;
288
	cell_t retval;
285
	uint32_t oldpix;
289
	uint32_t oldpix;
Lines 289-294 Link Here
289
	if (sc->fb.fb_flags & FB_FLAG_NOWRITE)
293
	if (sc->fb.fb_flags & FB_FLAG_NOWRITE)
290
		return;
294
		return;
291
295
296
	/* Open display device, thereby initializing it */
297
	memset(name, 0, sizeof(name));
298
	OF_package_to_path(sc->sc_node, name, sizeof(name));
299
	ih = OF_open(name);
300
292
	/*
301
	/*
293
	 * Set up the color map
302
	 * Set up the color map
294
	 */
303
	 */
Lines 300-306 Link Here
300
		    16, 255, 8, 255, 0);
309
		    16, 255, 8, 255, 0);
301
310
302
		for (i = 0; i < 16; i++) {
311
		for (i = 0; i < 16; i++) {
303
			err = OF_call_method("color!", sc->sc_handle, 4, 1,
312
			err = OF_call_method("color!", ih, 4, 1,
304
			    (cell_t)((sc->fb.fb_cmap[i] >> 16) & 0xff),
313
			    (cell_t)((sc->fb.fb_cmap[i] >> 16) & 0xff),
305
			    (cell_t)((sc->fb.fb_cmap[i] >> 8) & 0xff),
314
			    (cell_t)((sc->fb.fb_cmap[i] >> 8) & 0xff),
306
			    (cell_t)((sc->fb.fb_cmap[i] >> 0) & 0xff),
315
			    (cell_t)((sc->fb.fb_cmap[i] >> 0) & 0xff),
Lines 375-387 Link Here
375
	/* Keep track of the OF node */
384
	/* Keep track of the OF node */
376
	sc->sc_node = node;
385
	sc->sc_node = node;
377
386
378
	/*
379
	 * Try to use a 32-bit framebuffer if possible. This may be
380
	 * unimplemented and fail. That's fine -- it just means we are
381
	 * stuck with the defaults.
382
	 */
383
	OF_call_method("set-depth", sc->sc_handle, 1, 1, (cell_t)32, &i);
384
385
	/* Make sure we have needed properties */
387
	/* Make sure we have needed properties */
386
	if (OF_getproplen(node, "height") != sizeof(height) ||
388
	if (OF_getproplen(node, "height") != sizeof(height) ||
387
	    OF_getproplen(node, "width") != sizeof(width) ||
389
	    OF_getproplen(node, "width") != sizeof(width) ||

Return to bug 216123