diff options
author | Dave Airlie <airlied@redhat.com> | 2009-06-28 21:21:25 -0400 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2009-07-15 03:13:08 -0400 |
commit | 531369e62649bb8f31217cc0bf33ee6f89f1dff6 (patch) | |
tree | f06fe09aad7da81b2a56b2cb57932193178585cd /drivers/gpu/drm/radeon/r300.c | |
parent | 3e43d82125952826202a8cd20ba84a66f3ff8808 (diff) |
drm/radeon: fix support for vline relocations.
Userspace sends us a special relocation type to sync video/exa
to vlines to avoid tearing, this deals with the relocation
in the kernel, it picks the correct crtc and avoids issues
where crtcs are disabled.
This version also parses the wait until to make sure it isn't
trying to do anything evil.
Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/radeon/r300.c')
-rw-r--r-- | drivers/gpu/drm/radeon/r300.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/drivers/gpu/drm/radeon/r300.c b/drivers/gpu/drm/radeon/r300.c index cd9ea98e9c6f..656d9238bb06 100644 --- a/drivers/gpu/drm/radeon/r300.c +++ b/drivers/gpu/drm/radeon/r300.c | |||
@@ -44,6 +44,7 @@ int r100_gui_wait_for_idle(struct radeon_device *rdev); | |||
44 | int r100_cs_packet_parse(struct radeon_cs_parser *p, | 44 | int r100_cs_packet_parse(struct radeon_cs_parser *p, |
45 | struct radeon_cs_packet *pkt, | 45 | struct radeon_cs_packet *pkt, |
46 | unsigned idx); | 46 | unsigned idx); |
47 | int r100_cs_packet_parse_vline(struct radeon_cs_parser *p); | ||
47 | int r100_cs_packet_next_reloc(struct radeon_cs_parser *p, | 48 | int r100_cs_packet_next_reloc(struct radeon_cs_parser *p, |
48 | struct radeon_cs_reloc **cs_reloc); | 49 | struct radeon_cs_reloc **cs_reloc); |
49 | int r100_cs_parse_packet0(struct radeon_cs_parser *p, | 50 | int r100_cs_parse_packet0(struct radeon_cs_parser *p, |
@@ -972,7 +973,7 @@ static inline void r300_cs_track_clear(struct r300_cs_track *track) | |||
972 | 973 | ||
973 | static const unsigned r300_reg_safe_bm[159] = { | 974 | static const unsigned r300_reg_safe_bm[159] = { |
974 | 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, | 975 | 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, |
975 | 0xFFFFFFBF, 0xFFFFFFFF, 0xFFFFFFBF, 0xFFFFFFFF, | 976 | 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, |
976 | 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, | 977 | 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, |
977 | 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, | 978 | 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, |
978 | 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, | 979 | 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, |
@@ -1029,6 +1030,16 @@ static int r300_packet0_check(struct radeon_cs_parser *p, | |||
1029 | ib_chunk = &p->chunks[p->chunk_ib_idx]; | 1030 | ib_chunk = &p->chunks[p->chunk_ib_idx]; |
1030 | track = (struct r300_cs_track*)p->track; | 1031 | track = (struct r300_cs_track*)p->track; |
1031 | switch(reg) { | 1032 | switch(reg) { |
1033 | case AVIVO_D1MODE_VLINE_START_END: | ||
1034 | case RADEON_CRTC_GUI_TRIG_VLINE: | ||
1035 | r = r100_cs_packet_parse_vline(p); | ||
1036 | if (r) { | ||
1037 | DRM_ERROR("No reloc for ib[%d]=0x%04X\n", | ||
1038 | idx, reg); | ||
1039 | r100_cs_dump_packet(p, pkt); | ||
1040 | return r; | ||
1041 | } | ||
1042 | break; | ||
1032 | case RADEON_DST_PITCH_OFFSET: | 1043 | case RADEON_DST_PITCH_OFFSET: |
1033 | case RADEON_SRC_PITCH_OFFSET: | 1044 | case RADEON_SRC_PITCH_OFFSET: |
1034 | r = r100_cs_packet_next_reloc(p, &reloc); | 1045 | r = r100_cs_packet_next_reloc(p, &reloc); |