diff options
author | Dave Airlie <airlied@redhat.com> | 2009-11-16 15:29:46 -0500 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2009-12-07 16:33:04 -0500 |
commit | d904ef9b00a4473af16766e99f17bdbb5f0fde65 (patch) | |
tree | e9b5263b223cf5d20f189aad922f79c1ccbfd9c2 /drivers | |
parent | f84676185368e36c6bc0eeab87ab73ed39042648 (diff) |
drm/radeon/kms: add support to atom parser for FB read/write
FB read/write really doesn't need to access the actual VRAM, we
can just use a scratch area. This is required for using atom displayport
calls later.
Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/gpu/drm/radeon/atom.c | 8 | ||||
-rw-r--r-- | drivers/gpu/drm/radeon/atom.h | 2 | ||||
-rw-r--r-- | drivers/gpu/drm/radeon/radeon_device.c | 2 |
3 files changed, 8 insertions, 4 deletions
diff --git a/drivers/gpu/drm/radeon/atom.c b/drivers/gpu/drm/radeon/atom.c index d67c42555ab9..85abc0850e7f 100644 --- a/drivers/gpu/drm/radeon/atom.c +++ b/drivers/gpu/drm/radeon/atom.c | |||
@@ -263,10 +263,10 @@ static uint32_t atom_get_src_int(atom_exec_context *ctx, uint8_t attr, | |||
263 | case ATOM_ARG_FB: | 263 | case ATOM_ARG_FB: |
264 | idx = U8(*ptr); | 264 | idx = U8(*ptr); |
265 | (*ptr)++; | 265 | (*ptr)++; |
266 | val = gctx->scratch[((gctx->fb_base + idx) / 4)]; | ||
266 | if (print) | 267 | if (print) |
267 | DEBUG("FB[0x%02X]", idx); | 268 | DEBUG("FB[0x%02X]", idx); |
268 | printk(KERN_INFO "FB access is not implemented.\n"); | 269 | break; |
269 | return 0; | ||
270 | case ATOM_ARG_IMM: | 270 | case ATOM_ARG_IMM: |
271 | switch (align) { | 271 | switch (align) { |
272 | case ATOM_SRC_DWORD: | 272 | case ATOM_SRC_DWORD: |
@@ -488,9 +488,9 @@ static void atom_put_dst(atom_exec_context *ctx, int arg, uint8_t attr, | |||
488 | case ATOM_ARG_FB: | 488 | case ATOM_ARG_FB: |
489 | idx = U8(*ptr); | 489 | idx = U8(*ptr); |
490 | (*ptr)++; | 490 | (*ptr)++; |
491 | gctx->scratch[((gctx->fb_base + idx) / 4)] = val; | ||
491 | DEBUG("FB[0x%02X]", idx); | 492 | DEBUG("FB[0x%02X]", idx); |
492 | printk(KERN_INFO "FB access is not implemented.\n"); | 493 | break; |
493 | return; | ||
494 | case ATOM_ARG_PLL: | 494 | case ATOM_ARG_PLL: |
495 | idx = U8(*ptr); | 495 | idx = U8(*ptr); |
496 | (*ptr)++; | 496 | (*ptr)++; |
diff --git a/drivers/gpu/drm/radeon/atom.h b/drivers/gpu/drm/radeon/atom.h index e6eb38f2bcae..6671848e5ea1 100644 --- a/drivers/gpu/drm/radeon/atom.h +++ b/drivers/gpu/drm/radeon/atom.h | |||
@@ -132,6 +132,7 @@ struct atom_context { | |||
132 | uint8_t shift; | 132 | uint8_t shift; |
133 | int cs_equal, cs_above; | 133 | int cs_equal, cs_above; |
134 | int io_mode; | 134 | int io_mode; |
135 | uint32_t *scratch; | ||
135 | }; | 136 | }; |
136 | 137 | ||
137 | extern int atom_debug; | 138 | extern int atom_debug; |
@@ -142,6 +143,7 @@ int atom_asic_init(struct atom_context *); | |||
142 | void atom_destroy(struct atom_context *); | 143 | void atom_destroy(struct atom_context *); |
143 | void atom_parse_data_header(struct atom_context *ctx, int index, uint16_t *size, uint8_t *frev, uint8_t *crev, uint16_t *data_start); | 144 | void atom_parse_data_header(struct atom_context *ctx, int index, uint16_t *size, uint8_t *frev, uint8_t *crev, uint16_t *data_start); |
144 | void atom_parse_cmd_header(struct atom_context *ctx, int index, uint8_t *frev, uint8_t *crev); | 145 | void atom_parse_cmd_header(struct atom_context *ctx, int index, uint8_t *frev, uint8_t *crev); |
146 | int atom_allocate_fb_scratch(struct atom_context *ctx); | ||
145 | #include "atom-types.h" | 147 | #include "atom-types.h" |
146 | #include "atombios.h" | 148 | #include "atombios.h" |
147 | #include "ObjectID.h" | 149 | #include "ObjectID.h" |
diff --git a/drivers/gpu/drm/radeon/radeon_device.c b/drivers/gpu/drm/radeon/radeon_device.c index a014ba4cc97c..60ee6a8b4f7f 100644 --- a/drivers/gpu/drm/radeon/radeon_device.c +++ b/drivers/gpu/drm/radeon/radeon_device.c | |||
@@ -481,11 +481,13 @@ int radeon_atombios_init(struct radeon_device *rdev) | |||
481 | 481 | ||
482 | rdev->mode_info.atom_context = atom_parse(atom_card_info, rdev->bios); | 482 | rdev->mode_info.atom_context = atom_parse(atom_card_info, rdev->bios); |
483 | radeon_atom_initialize_bios_scratch_regs(rdev->ddev); | 483 | radeon_atom_initialize_bios_scratch_regs(rdev->ddev); |
484 | atom_allocate_fb_scratch(rdev->mode_info.atom_context); | ||
484 | return 0; | 485 | return 0; |
485 | } | 486 | } |
486 | 487 | ||
487 | void radeon_atombios_fini(struct radeon_device *rdev) | 488 | void radeon_atombios_fini(struct radeon_device *rdev) |
488 | { | 489 | { |
490 | kfree(rdev->mode_info.atom_context->scratch); | ||
489 | kfree(rdev->mode_info.atom_context); | 491 | kfree(rdev->mode_info.atom_context); |
490 | kfree(rdev->mode_info.atom_card_info); | 492 | kfree(rdev->mode_info.atom_card_info); |
491 | } | 493 | } |