Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit dfee5614 authored by Dave Airlie's avatar Dave Airlie
Browse files

drm/radeon/kms: respect single crtc cards, only create one crtc. (v2)



Also add single crtc for RN50 chips.

changes in v2:
fix vblank init to respect single crtc flag
fix r100 mode bandwidth to respect single crtc flag

Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
parent 185974dd
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
@@ -2135,10 +2135,12 @@ void r100_bandwidth_update(struct radeon_device *rdev)
		mode1 = &rdev->mode_info.crtcs[0]->base.mode;
		pixel_bytes1 = rdev->mode_info.crtcs[0]->base.fb->bits_per_pixel / 8;
	}
	if (!(rdev->flags & RADEON_SINGLE_CRTC)) {
		if (rdev->mode_info.crtcs[1]->base.enabled) {
			mode2 = &rdev->mode_info.crtcs[1]->base.mode;
			pixel_bytes2 = rdev->mode_info.crtcs[1]->base.fb->bits_per_pixel / 8;
		}
	}

	min_mem_eff.full = rfixed_const_8(0);
	/* get modes */
+5 −1
Original line number Diff line number Diff line
@@ -724,7 +724,11 @@ int radeon_modeset_init(struct radeon_device *rdev)
	if (ret) {
		return ret;
	}
	/* allocate crtcs - TODO single crtc */

	if (rdev->flags & RADEON_SINGLE_CRTC)
		num_crtc = 1;

	/* allocate crtcs */
	for (i = 0; i < num_crtc; i++) {
		radeon_crtc_init(rdev->ddev, i);
	}
+5 −1
Original line number Diff line number Diff line
@@ -1345,6 +1345,7 @@ radeon_atombios_set_dig_info(struct radeon_encoder *radeon_encoder)
void
radeon_add_atom_encoder(struct drm_device *dev, uint32_t encoder_id, uint32_t supported_device)
{
	struct radeon_device *rdev = dev->dev_private;
	struct drm_encoder *encoder;
	struct radeon_encoder *radeon_encoder;

@@ -1364,6 +1365,9 @@ radeon_add_atom_encoder(struct drm_device *dev, uint32_t encoder_id, uint32_t su
		return;

	encoder = &radeon_encoder->base;
	if (rdev->flags & RADEON_SINGLE_CRTC)
		encoder->possible_crtcs = 0x1;
	else
		encoder->possible_crtcs = 0x3;
	encoder->possible_clones = 0;

+6 −1
Original line number Diff line number Diff line
@@ -146,6 +146,7 @@ int radeonfb_create(struct drm_device *dev,
	unsigned long tmp;
	bool fb_tiled = false; /* useful for testing */
	u32 tiling_flags = 0;
	int crtc_count;

	mode_cmd.width = surface_width;
	mode_cmd.height = surface_height;
@@ -217,7 +218,11 @@ int radeonfb_create(struct drm_device *dev,
	rfbdev = info->par;
	rfbdev->helper.funcs = &radeon_fb_helper_funcs;
	rfbdev->helper.dev = dev;
	ret = drm_fb_helper_init_crtc_count(&rfbdev->helper, 2,
	if (rdev->flags & RADEON_SINGLE_CRTC)
		crtc_count = 1;
	else
		crtc_count = 2;
	ret = drm_fb_helper_init_crtc_count(&rfbdev->helper, crtc_count,
					    RADEONFB_CONN_LIMIT);
	if (ret)
		goto out_unref;
+5 −1
Original line number Diff line number Diff line
@@ -83,8 +83,12 @@ void radeon_driver_irq_uninstall_kms(struct drm_device *dev)
int radeon_irq_kms_init(struct radeon_device *rdev)
{
	int r = 0;
	int num_crtc = 2;

	r = drm_vblank_init(rdev->ddev, 2);
	if (rdev->flags & RADEON_SINGLE_CRTC)
		num_crtc = 1;

	r = drm_vblank_init(rdev->ddev, num_crtc);
	if (r) {
		return r;
	}
Loading