drm: Replace pitch with pitches[] in drm_framebuffer
Otherwise each driver would need to keep the information inside their own framebuffer object structure. Also add offsets[]. BOs on the other hand are driver specific, so those can be kept in driver specific structures. Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
This commit is contained in:
committed by
Dave Airlie
parent
935b597740
commit
01f2c7730e
@@ -1153,7 +1153,7 @@ static int dce4_crtc_do_set_base(struct drm_crtc *crtc,
|
||||
WREG32(EVERGREEN_GRPH_X_END + radeon_crtc->crtc_offset, target_fb->width);
|
||||
WREG32(EVERGREEN_GRPH_Y_END + radeon_crtc->crtc_offset, target_fb->height);
|
||||
|
||||
fb_pitch_pixels = target_fb->pitch / (target_fb->bits_per_pixel / 8);
|
||||
fb_pitch_pixels = target_fb->pitches[0] / (target_fb->bits_per_pixel / 8);
|
||||
WREG32(EVERGREEN_GRPH_PITCH + radeon_crtc->crtc_offset, fb_pitch_pixels);
|
||||
WREG32(EVERGREEN_GRPH_ENABLE + radeon_crtc->crtc_offset, 1);
|
||||
|
||||
@@ -1322,7 +1322,7 @@ static int avivo_crtc_do_set_base(struct drm_crtc *crtc,
|
||||
WREG32(AVIVO_D1GRPH_X_END + radeon_crtc->crtc_offset, target_fb->width);
|
||||
WREG32(AVIVO_D1GRPH_Y_END + radeon_crtc->crtc_offset, target_fb->height);
|
||||
|
||||
fb_pitch_pixels = target_fb->pitch / (target_fb->bits_per_pixel / 8);
|
||||
fb_pitch_pixels = target_fb->pitches[0] / (target_fb->bits_per_pixel / 8);
|
||||
WREG32(AVIVO_D1GRPH_PITCH + radeon_crtc->crtc_offset, fb_pitch_pixels);
|
||||
WREG32(AVIVO_D1GRPH_ENABLE + radeon_crtc->crtc_offset, 1);
|
||||
|
||||
|
||||
@@ -406,7 +406,7 @@ static int radeon_crtc_page_flip(struct drm_crtc *crtc,
|
||||
if (!ASIC_IS_AVIVO(rdev)) {
|
||||
/* crtc offset is from display base addr not FB location */
|
||||
base -= radeon_crtc->legacy_display_base_addr;
|
||||
pitch_pixels = fb->pitch / (fb->bits_per_pixel / 8);
|
||||
pitch_pixels = fb->pitches[0] / (fb->bits_per_pixel / 8);
|
||||
|
||||
if (tiling_flags & RADEON_TILING_MACRO) {
|
||||
if (ASIC_IS_R300(rdev)) {
|
||||
|
||||
@@ -232,7 +232,7 @@ static int radeonfb_create(struct radeon_fbdev *rfbdev,
|
||||
|
||||
strcpy(info->fix.id, "radeondrmfb");
|
||||
|
||||
drm_fb_helper_fill_fix(info, fb->pitch, fb->depth);
|
||||
drm_fb_helper_fill_fix(info, fb->pitches[0], fb->depth);
|
||||
|
||||
info->flags = FBINFO_DEFAULT | FBINFO_CAN_FORCE_OUTPUT;
|
||||
info->fbops = &radeonfb_ops;
|
||||
@@ -275,7 +275,7 @@ static int radeonfb_create(struct radeon_fbdev *rfbdev,
|
||||
DRM_INFO("vram apper at 0x%lX\n", (unsigned long)rdev->mc.aper_base);
|
||||
DRM_INFO("size %lu\n", (unsigned long)radeon_bo_size(rbo));
|
||||
DRM_INFO("fb depth is %d\n", fb->depth);
|
||||
DRM_INFO(" pitch is %d\n", fb->pitch);
|
||||
DRM_INFO(" pitch is %d\n", fb->pitches[0]);
|
||||
|
||||
vga_switcheroo_client_fb_set(rdev->ddev->pdev, info);
|
||||
return 0;
|
||||
|
||||
@@ -437,7 +437,7 @@ int radeon_crtc_do_set_base(struct drm_crtc *crtc,
|
||||
|
||||
crtc_offset_cntl = 0;
|
||||
|
||||
pitch_pixels = target_fb->pitch / (target_fb->bits_per_pixel / 8);
|
||||
pitch_pixels = target_fb->pitches[0] / (target_fb->bits_per_pixel / 8);
|
||||
crtc_pitch = (((pitch_pixels * target_fb->bits_per_pixel) +
|
||||
((target_fb->bits_per_pixel * 8) - 1)) /
|
||||
(target_fb->bits_per_pixel * 8));
|
||||
|
||||
Reference in New Issue
Block a user