Changeset c7d11a0b in mainline


Ignore:
Timestamp:
2013-01-21T00:10:36Z (11 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
a14f346
Parents:
6ab189f
Message:

amdm37x_dispc: Fixes.

Assign vizualizer ops.
Store pointer to newly created fb.
Compile fixes in previously unused functions.
Pass bits per pixel instead of bytes to the setup function.
Drop kfb leftovers.

Location:
uspace/drv/fb/amdm37x_dispc
Files:
2 deleted
3 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/fb/amdm37x_dispc/Makefile

    r6ab189f rc7d11a0b  
    4444
    4545SOURCES = \
    46         port.c \
    4746        amdm37x_dispc.c \
    4847        main.c
  • uspace/drv/fb/amdm37x_dispc/amdm37x_dispc.c

    r6ab189f rc7d11a0b  
    4242#include "amdm37x_dispc.h"
    4343
    44 
    4544static int change_mode(visualizer_t *vis, vslmode_t mode);
    4645static int handle_damage(visualizer_t *vs,
    4746    sysarg_t x0, sysarg_t y0, sysarg_t width, sysarg_t height,
    4847    sysarg_t x_offset, sysarg_t y_offset);
     48static int dummy(visualizer_t *vs)
     49{
     50        return EOK;
     51}
    4952
    5053static const visualizer_ops_t amdm37x_dispc_vis_ops = {
    5154        .change_mode = change_mode,
    5255        .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,
    5460};
    55 
    5661
    5762static const struct {
     
    127132        vis->dev_ctx = instance;
    128133        vis->def_mode_idx = 0;
     134        vis->ops = amdm37x_dispc_vis_ops;
    129135        list_append(&instance->modes[0].link, &vis->modes);
    130136
     
    237243        regs->control |= AMDM37X_DISPC_CONTROL_LCD_ENABLE_FLAG;
    238244        regs->control |= AMDM37X_DISPC_CONTROL_DIGITAL_ENABLE_FLAG;
     245        return EOK;
    239246}
    240247
     
    251258        const unsigned x = mode.screen_width;
    252259        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);
    255262        void *buffer, *pa;
    256263        int ret = dmamem_map_anonymous(size, AS_AREA_READ | AS_AREA_WRITE,
     
    260267                return ret;
    261268        }
    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);
    263270        dispc->active_fb.idx = mode.index;
    264271        dispc->active_fb.width = x;
     
    267274        dispc->active_fb.bpp = bpp;
    268275        dispc->active_fb.pixel2visual = p2v;
     276        dispc->fb_data = buffer;
     277        dispc->size = size;
    269278        assert(mode.index < 1);
    270279
  • uspace/drv/fb/amdm37x_dispc/main.c

    r6ab189f rc7d11a0b  
    4141#include <ops/graph_dev.h>
    4242#include <graph.h>
    43 #include "port.h"
    4443
    4544#include "amdm37x_dispc.h"
     
    5756static int amdm37x_dispc_dev_add(ddf_dev_t *dev)
    5857{
     58        assert(dev);
    5959        /* Visualizer part */
    60         ddf_fun_t *fun = ddf_fun_create(dev, fun_exposed, "dispc");
     60        ddf_fun_t *fun = ddf_fun_create(dev, fun_exposed, "viz");
    6161        if (!fun) {
    6262                ddf_log_error("Failed to create visualizer function\n");
     
    100100        }
    101101        ddf_fun_add_to_category(fun, "visualizer");
     102
     103        ddf_log_note("Added device `%s'\n", ddf_dev_get_name(dev));
    102104        return EOK;
    103105}
Note: See TracChangeset for help on using the changeset viewer.