Changeset c7d11a0b in mainline for uspace/drv/fb/amdm37x_dispc/amdm37x_dispc.c
- Timestamp:
- 2013-01-21T00:10:36Z (12 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- a14f346
- Parents:
- 6ab189f
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/fb/amdm37x_dispc/amdm37x_dispc.c
r6ab189f rc7d11a0b 42 42 #include "amdm37x_dispc.h" 43 43 44 45 44 static int change_mode(visualizer_t *vis, vslmode_t mode); 46 45 static int handle_damage(visualizer_t *vs, 47 46 sysarg_t x0, sysarg_t y0, sysarg_t width, sysarg_t height, 48 47 sysarg_t x_offset, sysarg_t y_offset); 48 static int dummy(visualizer_t *vs) 49 { 50 return EOK; 51 } 49 52 50 53 static const visualizer_ops_t amdm37x_dispc_vis_ops = { 51 54 .change_mode = change_mode, 52 55 .handle_damage = handle_damage, 53 // TODO DO we need dummy implementations of stuff like claim, yield, ... 56 .claim = dummy, 57 .yield = dummy, 58 .suspend = dummy, 59 .wakeup = dummy, 54 60 }; 55 56 61 57 62 static const struct { … … 127 132 vis->dev_ctx = instance; 128 133 vis->def_mode_idx = 0; 134 vis->ops = amdm37x_dispc_vis_ops; 129 135 list_append(&instance->modes[0].link, &vis->modes); 130 136 … … 237 243 regs->control |= AMDM37X_DISPC_CONTROL_LCD_ENABLE_FLAG; 238 244 regs->control |= AMDM37X_DISPC_CONTROL_DIGITAL_ENABLE_FLAG; 245 return EOK; 239 246 } 240 247 … … 251 258 const unsigned x = mode.screen_width; 252 259 const unsigned y = mode.screen_height; 253 ddf_log_note("Setting mode: %ux%ux%u\n", x, y, bpp );254 const size_t size = x * y * bpp;260 ddf_log_note("Setting mode: %ux%ux%u\n", x, y, bpp*8); 261 const size_t size = ALIGN_UP(x * y * bpp, PAGE_SIZE); 255 262 void *buffer, *pa; 256 263 int ret = dmamem_map_anonymous(size, AS_AREA_READ | AS_AREA_WRITE, … … 260 267 return ret; 261 268 } 262 amdm37x_dispc_setup_fb(dispc->regs, x, y, bpp , (uint32_t)pa);269 amdm37x_dispc_setup_fb(dispc->regs, x, y, bpp *8, (uint32_t)pa); 263 270 dispc->active_fb.idx = mode.index; 264 271 dispc->active_fb.width = x; … … 267 274 dispc->active_fb.bpp = bpp; 268 275 dispc->active_fb.pixel2visual = p2v; 276 dispc->fb_data = buffer; 277 dispc->size = size; 269 278 assert(mode.index < 1); 270 279
Note:
See TracChangeset
for help on using the changeset viewer.