Changeset f03f107 in mainline
- Timestamp:
- 2013-01-20T22:40:05Z (12 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 943a1dc6
- Parents:
- 7fa2031
- Location:
- uspace/drv/fb/amdm37x_dispc
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/fb/amdm37x_dispc/amdm37x_dispc.c
r7fa2031 rf03f107 244 244 } 245 245 246 static int handle_damage(visualizer_t *vs,247 sysarg_t x0, sysarg_t y0, sysarg_t width, sysarg_t height,248 sysarg_t x_offset, sysarg_t y_offset)249 {250 ddf_log_fatal("Handling damage\n");251 return EOK;252 }253 254 246 static int change_mode(visualizer_t *vis, vslmode_t mode) 255 247 { … … 258 250 259 251 amdm37x_dispc_t *dispc = vis->dev_ctx; 260 const unsigned bpp = visual2bpp(mode.cell_visual.pixel_visual); 252 const visual_t visual = mode.cell_visual.pixel_visual; 253 const unsigned bpp = visual2bpp(visual); 261 254 const unsigned x = mode.screen_width; 262 255 const unsigned y = mode.screen_height; … … 271 264 } 272 265 amdm37x_dispc_setup_fb(dispc->regs, x, y, bpp, (uint32_t)pa); 266 dispc->active_fb.idx = mode.index; 267 dispc->active_fb.width = x; 268 dispc->active_fb.height = y; 269 dispc->active_fb.pitch = 0; 270 dispc->active_fb.bpp = bpp; 271 assert(mode.index < 1); 273 272 274 273 if (dispc->fb_data) … … 276 275 return EOK; 277 276 } 277 278 static int handle_damage(visualizer_t *vs, 279 sysarg_t x0, sysarg_t y0, sysarg_t width, sysarg_t height, 280 sysarg_t x_offset, sysarg_t y_offset) 281 { 282 assert(vs); 283 assert(vs->dev_ctx); 284 amdm37x_dispc_t *dispc = vs->dev_ctx; 285 pixelmap_t *map = &vs->cells; 286 287 #define FB_POS(x, y) \ 288 (((y) * (dispc->active_fb.width + dispc->active_fb.pitch) + (x)) \ 289 * dispc->active_fb.bpp) 290 if (x_offset == 0 && y_offset == 0) { 291 /* Faster damage routine ignoring offsets. */ 292 for (sysarg_t y = y0; y < height + y0; ++y) { 293 pixel_t *pixel = pixelmap_pixel_at(map, x0, y); 294 for (sysarg_t x = x0; x < width + x0; ++x) { 295 dispc->pixel2visual( 296 dispc->fb_data + FB_POS(x, y), *pixel++); 297 } 298 } 299 } else { 300 for (sysarg_t y = y0; y < height + y0; ++y) { 301 for (sysarg_t x = x0; x < width + x0; ++x) { 302 dispc->pixel2visual( 303 dispc->fb_data + FB_POS(x, y), 304 *pixelmap_pixel_at(map, 305 (x + x_offset) % map->width, 306 (y + y_offset) % map->height)); 307 } 308 } 309 } 310 311 ddf_log_note("Handling damage\n"); 312 return EOK; 313 } 314 -
uspace/drv/fb/amdm37x_dispc/amdm37x_dispc.h
r7fa2031 rf03f107 46 46 amdm37x_dispc_regs_t *regs; 47 47 48 unsigned fb_width;49 unsigned fb_height;50 48 unsigned offset; 51 unsigned scanline;52 49 visual_t visual; 53 50 … … 55 52 visual2pixel_t visual2pixel; 56 53 visual_mask_t visual_mask; 57 unsigned pixel_bytes; 54 55 struct { 56 unsigned width; 57 unsigned height; 58 unsigned pitch; 59 unsigned bpp; 60 unsigned idx; 61 } active_fb; 58 62 59 63 size_t size;
Note:
See TracChangeset
for help on using the changeset viewer.