Subversion Repositories Kolibri OS

Rev

Rev 1221 | Rev 1404 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1221 Rev 1268
Line 135... Line 135...
135
	int i;
135
	int i;
Line 136... Line 136...
136
 
136
 
137
	if (size != 256) {
137
	if (size != 256) {
138
		return;
138
		return;
139
	}
-
 
140
	if (crtc->fb == NULL) {
-
 
141
		return;
-
 
Line 142... Line 139...
142
	}
139
	}
143
 
140
 
144
	/* userspace palettes are always correct as is */
141
	/* userspace palettes are always correct as is */
145
		for (i = 0; i < 256; i++) {
142
		for (i = 0; i < 256; i++) {
146
			radeon_crtc->lut_r[i] = red[i] >> 6;
143
			radeon_crtc->lut_r[i] = red[i] >> 6;
147
			radeon_crtc->lut_g[i] = green[i] >> 6;
144
			radeon_crtc->lut_g[i] = green[i] >> 6;
148
			radeon_crtc->lut_b[i] = blue[i] >> 6;
-
 
149
		}
145
			radeon_crtc->lut_b[i] = blue[i] >> 6;
150
 
146
		}
Line 151... Line 147...
151
	radeon_crtc_load_lut(crtc);
147
	radeon_crtc_load_lut(crtc);
152
}
148
}
Line 336... Line 332...
336
	return ret;
332
	return ret;
337
}
333
}
Line 338... Line 334...
338
 
334
 
339
int radeon_ddc_get_modes(struct radeon_connector *radeon_connector)
335
int radeon_ddc_get_modes(struct radeon_connector *radeon_connector)
340
{
-
 
341
	struct edid *edid;
336
{
Line 342... Line 337...
342
	int ret = 0;
337
	int ret = 0;
343
 
338
 
344
	if (!radeon_connector->ddc_bus)
339
	if (!radeon_connector->ddc_bus)
345
		return -1;
340
		return -1;
346
	if (!radeon_connector->edid) {
341
	if (!radeon_connector->edid) {
347
	radeon_i2c_do_lock(radeon_connector, 1);
342
	radeon_i2c_do_lock(radeon_connector, 1);
348
	edid = drm_get_edid(&radeon_connector->base, &radeon_connector->ddc_bus->adapter);
343
		radeon_connector->edid = drm_get_edid(&radeon_connector->base, &radeon_connector->ddc_bus->adapter);
349
	radeon_i2c_do_lock(radeon_connector, 0);
-
 
Line 350... Line -...
350
	} else
-
 
351
		edid = radeon_connector->edid;
-
 
352
 
-
 
353
	if (edid) {
344
	radeon_i2c_do_lock(radeon_connector, 0);
354
		/* update digital bits here */
-
 
355
		if (edid->input & DRM_EDID_INPUT_DIGITAL)
-
 
356
			radeon_connector->use_digital = 1;
345
	}
357
		else
346
 
358
			radeon_connector->use_digital = 0;
-
 
359
		drm_mode_connector_update_edid_property(&radeon_connector->base, edid);
347
	if (radeon_connector->edid) {
360
		ret = drm_add_edid_modes(&radeon_connector->base, edid);
348
		drm_mode_connector_update_edid_property(&radeon_connector->base, radeon_connector->edid);
361
		kfree(edid);
349
		ret = drm_add_edid_modes(&radeon_connector->base, radeon_connector->edid);
362
		return ret;
350
		return ret;
363
	}
351
	}
Line 758... Line 746...
758
	struct drm_encoder *encoder;
746
	struct drm_encoder *encoder;
759
		struct radeon_crtc *radeon_crtc = to_radeon_crtc(crtc);
747
		struct radeon_crtc *radeon_crtc = to_radeon_crtc(crtc);
760
	struct radeon_encoder *radeon_encoder;
748
	struct radeon_encoder *radeon_encoder;
761
	bool first = true;
749
	bool first = true;
Line 762... Line -...
762
 
-
 
763
    ENTER();
-
 
764
 
750
 
765
	list_for_each_entry(encoder, &dev->mode_config.encoder_list, head) {
751
	list_for_each_entry(encoder, &dev->mode_config.encoder_list, head) {
766
		radeon_encoder = to_radeon_encoder(encoder);
752
		radeon_encoder = to_radeon_encoder(encoder);
767
		if (encoder->crtc != crtc)
753
		if (encoder->crtc != crtc)
768
			continue;
754
			continue;
769
		if (first) {
755
		if (first) {
770
			radeon_crtc->rmx_type = radeon_encoder->rmx_type;
756
			radeon_crtc->rmx_type = radeon_encoder->rmx_type;
771
			memcpy(&radeon_crtc->native_mode,
757
			memcpy(&radeon_crtc->native_mode,
772
				&radeon_encoder->native_mode,
758
				&radeon_encoder->native_mode,
773
				sizeof(struct radeon_native_mode));
759
				sizeof(struct drm_display_mode));
774
			first = false;
760
			first = false;
775
		} else {
761
		} else {
776
			if (radeon_crtc->rmx_type != radeon_encoder->rmx_type) {
762
			if (radeon_crtc->rmx_type != radeon_encoder->rmx_type) {
777
				/* WARNING: Right now this can't happen but
763
				/* WARNING: Right now this can't happen but
Line 784... Line 770...
784
				return false;
770
				return false;
785
			}
771
			}
786
		}
772
		}
787
	}
773
	}
788
	if (radeon_crtc->rmx_type != RMX_OFF) {
774
	if (radeon_crtc->rmx_type != RMX_OFF) {
789
 
-
 
790
        dbgprintf("\nset scaler panel_xres %d panel_yres %d\n",
-
 
791
                  radeon_crtc->native_mode.panel_xres,
-
 
792
                  radeon_crtc->native_mode.panel_yres);
-
 
793
 
-
 
794
        fixed20_12 a, b;
775
        fixed20_12 a, b;
795
		a.full = rfixed_const(crtc->mode.vdisplay);
776
		a.full = rfixed_const(crtc->mode.vdisplay);
796
		b.full = rfixed_const(radeon_crtc->native_mode.panel_xres);
777
		b.full = rfixed_const(radeon_crtc->native_mode.hdisplay);
797
		radeon_crtc->vsc.full = rfixed_div(a, b);
778
		radeon_crtc->vsc.full = rfixed_div(a, b);
798
		a.full = rfixed_const(crtc->mode.hdisplay);
779
		a.full = rfixed_const(crtc->mode.hdisplay);
799
		b.full = rfixed_const(radeon_crtc->native_mode.panel_yres);
780
		b.full = rfixed_const(radeon_crtc->native_mode.vdisplay);
800
		radeon_crtc->hsc.full = rfixed_div(a, b);
781
		radeon_crtc->hsc.full = rfixed_div(a, b);
801
	} else {
782
	} else {
802
		radeon_crtc->vsc.full = rfixed_const(1);
783
		radeon_crtc->vsc.full = rfixed_const(1);
803
		radeon_crtc->hsc.full = rfixed_const(1);
784
		radeon_crtc->hsc.full = rfixed_const(1);
804
	}
785
	}
805
 
-
 
806
    LEAVE();
-
 
807
 
-
 
808
	return true;
786
	return true;
809
}
787
}