add: if (!crt_only) nm_crtc_prg_panel();
context: status_t SET_DISPLAY_MODE(display_mode *mode_to_set) {	/* BOUNDS WARNING:	 * It's impossible to deviate whatever small amount in a display_mode if the lower	 * and upper limits are the same!	 * Besides:	 * BeOS (tested R5.0.3PE) is failing BWindowScreen::SetFrameBuffer() if PROPOSEMODE	 * returns B_BAD_VALUE!	 * Which means PROPOSEMODE should not return that on anything except on	 * deviations for:	 * display_mode.virtual_width;	 * display_mode.virtual_height;	 * display_mode.timing.h_display;	 * display_mode.timing.v_display;	 * So:	 * We don't use bounds here by making sure bounds and target are the same struct!	 * (See the call to PROPOSE_DISPLAY_MODE below) */	display_mode /*bounds,*/ target;	uint8 colour_depth = 24;	uint32 startadd;	bool display, h, v;	/* if internal panel is active we don't touch the CRTC timing and the pixelPLL */	bool crt_only = true;	/* Adjust mode to valid one and fail if invalid */	target /*= bounds*/ = *mode_to_set;	/* show the mode bits */	LOG(1, ("SETMODE: (ENTER) initial modeflags: $%08x\n", target.flags));	LOG(1, ("SETMODE: requested target pixelclock %dkHz\n",  target.timing.pixel_clock));	LOG(1, ("SETMODE: requested virtual_width %d, virtual_height %d\n",										target.virtual_width, target.virtual_height));	/* See BOUNDS WARNING above... */	if (PROPOSE_DISPLAY_MODE(&target, &target, &target) == B_ERROR)	return B_ERROR;	/* if we have the flatpanel turned on modify visible part of mode if nessesary */	if (nm_general_output_read() & 0x02)	{		LOG(4,("SETMODE: internal flatpanel enabled, skipping CRTC/pixelPLL setup\n"));		crt_only = false;	}	/* disable interrupts using the kernel driver */	interrupt_enable(false);	/* make sure the card's registers are unlocked (KB output select may lock!) */	nm_unlock();	/* find current DPMS state, then turn off screen(s) */	nm_crtc_dpms_fetch(&display, &h, &v);	nm_crtc_dpms(false, false, false);	/*where in framebuffer the screen is (should this be dependant on previous MOVEDISPLAY?)*/	startadd = (uint8*)si->fbc.frame_buffer - (uint8*)si->framebuffer;	/* Perform the mode switch */	{		status_t status = B_OK;		int colour_mode = BPP24;				switch(target.space)		{		case B_CMAP8:        colour_depth =  8; colour_mode = BPP8;  break;		case B_RGB15_LITTLE: colour_depth = 16; colour_mode = BPP15; break;		case B_RGB16_LITTLE: colour_depth = 16; colour_mode = BPP16; break;		case B_RGB24_LITTLE: colour_depth = 24; colour_mode = BPP24; break;		default:			LOG(8,("SETMODE: Invalid colorspace $%08x\n", target.space));			return B_ERROR;		}		/* calculate and set new mode bytes_per_row */		nm_general_validate_pic_size (&target, &si->fbc.bytes_per_row, &si->acc_mode);		/* set the pixelclock PLL */		if (crt_only)		{			status = nm_dac_set_pix_pll(target);			if (status == B_ERROR)				LOG(8,("CRTC: error setting pixelclock\n"));		}		/* set the colour depth for CRTC1 and the DAC */		nm_dac_mode(colour_mode, 1.0);		nm_crtc_depth(colour_mode);				/* set the display pitch */		nm_crtc_set_display_pitch();		/* tell the card what memory to display */		nm_crtc_set_display_start(startadd,colour_depth);		/* enable primary analog output */		//fixme: choose output connector(s)				/* set the timing */		nm_crtc_set_timing(target, crt_only);		/* always setup centering so a KB BIOS switch to flatpanel will go OK... */		nm_crtc_center(target, crt_only);	}	/* update driver's mode store */	si->dm = target;	/* turn screen on */	nm_crtc_dpms(display,h,v);	/* set up acceleration for this mode */	nm_acc_init();	/* log currently selected output */	nm_general_output_select();	LOG(1,("SETMODE: booted since %f mS\n", system_time()/1000.0));	/* enable interrupts using the kernel driver */	interrupt_enable(true);	/* Tune RAM CAS-latency if needed. Must be done *here*! */	nm_set_cas_latency();	return B_OK;}