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

Commit 489f3267 authored by Ville Syrjälä's avatar Ville Syrjälä
Browse files

drm/radeon: Add local 'fb' variables



Add a local 'fb' variable to a few places to get rid of the
'crtc->primary->fb' stuff. Looks neater and helps me with my poor
coccinelle skills later.

Cc: Alex Deucher <alexander.deucher@amd.com>
Cc: "Christian König" <christian.koenig@amd.com>
Signed-off-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: default avatarAlex Deucher <alexander.deucher@amd.com>
Reviewed-by: default avatarChristian König <christian.koenig@amd.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1479498793-31021-3-git-send-email-ville.syrjala@linux.intel.com
parent 1967b34d
Loading
Loading
Loading
Loading
+8 −2
Original line number Diff line number Diff line
@@ -3225,13 +3225,19 @@ void r100_bandwidth_update(struct radeon_device *rdev)
	radeon_update_display_priority(rdev);

	if (rdev->mode_info.crtcs[0]->base.enabled) {
		const struct drm_framebuffer *fb =
			rdev->mode_info.crtcs[0]->base.primary->fb;

		mode1 = &rdev->mode_info.crtcs[0]->base.mode;
		pixel_bytes1 = rdev->mode_info.crtcs[0]->base.primary->fb->bits_per_pixel / 8;
		pixel_bytes1 = fb->bits_per_pixel / 8;
	}
	if (!(rdev->flags & RADEON_SINGLE_CRTC)) {
		if (rdev->mode_info.crtcs[1]->base.enabled) {
			const struct drm_framebuffer *fb =
				rdev->mode_info.crtcs[1]->base.primary->fb;

			mode2 = &rdev->mode_info.crtcs[1]->base.mode;
			pixel_bytes2 = rdev->mode_info.crtcs[1]->base.primary->fb->bits_per_pixel / 8;
			pixel_bytes2 = fb->bits_per_pixel / 8;
		}
	}

+2 −1
Original line number Diff line number Diff line
@@ -579,6 +579,7 @@ static bool radeon_set_crtc_timing(struct drm_crtc *crtc, struct drm_display_mod
	struct drm_device *dev = crtc->dev;
	struct radeon_device *rdev = dev->dev_private;
	struct radeon_crtc *radeon_crtc = to_radeon_crtc(crtc);
	const struct drm_framebuffer *fb = crtc->primary->fb;
	struct drm_encoder *encoder;
	int format;
	int hsync_start;
@@ -602,7 +603,7 @@ static bool radeon_set_crtc_timing(struct drm_crtc *crtc, struct drm_display_mod
		}
	}

	switch (crtc->primary->fb->bits_per_pixel) {
	switch (fb->bits_per_pixel) {
	case 8:
		format = 2;
		break;