| .. | .. |
|---|
| 23 | 23 | * Authors: Dave Airlie |
|---|
| 24 | 24 | * Alex Deucher |
|---|
| 25 | 25 | */ |
|---|
| 26 | | -#include <drm/drmP.h> |
|---|
| 26 | + |
|---|
| 27 | 27 | #include <drm/drm_crtc_helper.h> |
|---|
| 28 | 28 | #include <drm/drm_fb_helper.h> |
|---|
| 29 | | -#include <drm/radeon_drm.h> |
|---|
| 30 | 29 | #include <drm/drm_fixed.h> |
|---|
| 30 | +#include <drm/drm_fourcc.h> |
|---|
| 31 | +#include <drm/drm_vblank.h> |
|---|
| 32 | +#include <drm/radeon_drm.h> |
|---|
| 33 | + |
|---|
| 31 | 34 | #include "radeon.h" |
|---|
| 32 | 35 | #include "atom.h" |
|---|
| 33 | 36 | #include "atom-bits.h" |
|---|
| .. | .. |
|---|
| 241 | 244 | |
|---|
| 242 | 245 | atom_execute_table(rdev->mode_info.atom_context, index, (uint32_t *)&args); |
|---|
| 243 | 246 | |
|---|
| 244 | | - if (ASIC_IS_DCE8(rdev)) { |
|---|
| 247 | + if (ASIC_IS_DCE8(rdev)) |
|---|
| 245 | 248 | WREG32(vga_control_regs[radeon_crtc->crtc_id], vga_control); |
|---|
| 246 | | - } |
|---|
| 247 | 249 | } |
|---|
| 248 | 250 | |
|---|
| 249 | 251 | static void atombios_powergate_crtc(struct drm_crtc *crtc, int state) |
|---|
| .. | .. |
|---|
| 1254 | 1256 | /* Greater 8 bpc fb needs to bypass hw-lut to retain precision */ |
|---|
| 1255 | 1257 | bypass_lut = true; |
|---|
| 1256 | 1258 | break; |
|---|
| 1259 | + case DRM_FORMAT_XBGR8888: |
|---|
| 1260 | + case DRM_FORMAT_ABGR8888: |
|---|
| 1261 | + fb_format = (EVERGREEN_GRPH_DEPTH(EVERGREEN_GRPH_DEPTH_32BPP) | |
|---|
| 1262 | + EVERGREEN_GRPH_FORMAT(EVERGREEN_GRPH_FORMAT_ARGB8888)); |
|---|
| 1263 | + fb_swap = (EVERGREEN_GRPH_RED_CROSSBAR(EVERGREEN_GRPH_RED_SEL_B) | |
|---|
| 1264 | + EVERGREEN_GRPH_BLUE_CROSSBAR(EVERGREEN_GRPH_BLUE_SEL_R)); |
|---|
| 1265 | +#ifdef __BIG_ENDIAN |
|---|
| 1266 | + fb_swap |= EVERGREEN_GRPH_ENDIAN_SWAP(EVERGREEN_GRPH_ENDIAN_8IN32); |
|---|
| 1267 | +#endif |
|---|
| 1268 | + break; |
|---|
| 1257 | 1269 | default: |
|---|
| 1258 | 1270 | DRM_ERROR("Unsupported screen format %s\n", |
|---|
| 1259 | 1271 | drm_get_format_name(target_fb->format->format, &format_name)); |
|---|
| .. | .. |
|---|
| 1550 | 1562 | #endif |
|---|
| 1551 | 1563 | /* Greater 8 bpc fb needs to bypass hw-lut to retain precision */ |
|---|
| 1552 | 1564 | bypass_lut = true; |
|---|
| 1565 | + break; |
|---|
| 1566 | + case DRM_FORMAT_XBGR8888: |
|---|
| 1567 | + case DRM_FORMAT_ABGR8888: |
|---|
| 1568 | + fb_format = |
|---|
| 1569 | + AVIVO_D1GRPH_CONTROL_DEPTH_32BPP | |
|---|
| 1570 | + AVIVO_D1GRPH_CONTROL_32BPP_ARGB8888; |
|---|
| 1571 | + if (rdev->family >= CHIP_R600) |
|---|
| 1572 | + fb_swap = |
|---|
| 1573 | + (R600_D1GRPH_RED_CROSSBAR(R600_D1GRPH_RED_SEL_B) | |
|---|
| 1574 | + R600_D1GRPH_BLUE_CROSSBAR(R600_D1GRPH_BLUE_SEL_R)); |
|---|
| 1575 | + else /* DCE1 (R5xx) */ |
|---|
| 1576 | + fb_format |= AVIVO_D1GRPH_SWAP_RB; |
|---|
| 1577 | +#ifdef __BIG_ENDIAN |
|---|
| 1578 | + fb_swap |= R600_D1GRPH_SWAP_ENDIAN_32BIT; |
|---|
| 1579 | +#endif |
|---|
| 1553 | 1580 | break; |
|---|
| 1554 | 1581 | default: |
|---|
| 1555 | 1582 | DRM_ERROR("Unsupported screen format %s\n", |
|---|
| .. | .. |
|---|
| 2204 | 2231 | .prepare = atombios_crtc_prepare, |
|---|
| 2205 | 2232 | .commit = atombios_crtc_commit, |
|---|
| 2206 | 2233 | .disable = atombios_crtc_disable, |
|---|
| 2234 | + .get_scanout_position = radeon_get_crtc_scanout_position, |
|---|
| 2207 | 2235 | }; |
|---|
| 2208 | 2236 | |
|---|
| 2209 | 2237 | void radeon_atombios_init_crtc(struct drm_device *dev, |
|---|