Changeset 9cc4b2b4 in mainline


Ignore:
Timestamp:
2013-01-20T21:06:33Z (12 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
96228d0
Parents:
74db5a1
Message:

amdm37x_dispc: Init vizualizer.

Location:
uspace/drv/fb/amdm37x_dispc
Files:
1 added
3 edited

Legend:

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

    r74db5a1 r9cc4b2b4  
    4545SOURCES = \
    4646        port.c \
     47        amdm37x_dispc.c \
    4748        main.c
    4849
  • uspace/drv/fb/amdm37x_dispc/amdm37x_dispc.h

    r74db5a1 r9cc4b2b4  
    3737#define AMDM37X_DISPC_H_
    3838
     39#include <graph.h>
     40
    3941#include "amdm37x_dispc_regs.h"
    4042
     
    4446} amdm37x_dispc_t;
    4547
    46 static inline int amdm37x_dispc_init(amdm37x_dispc_t *instance)
    47 {
    48         return EOK;
    49 };
    50 static inline int amdm37x_dispc_fini(amdm37x_dispc_t *instance)
    51 {
    52         return EOK;
    53 };
     48extern const visualizer_ops_t amdm37x_dispc_vis_ops;
     49
     50int amdm37x_dispc_init(amdm37x_dispc_t *instance);
     51int amdm37x_dispc_fini(amdm37x_dispc_t *instance);
    5452
    5553#endif
    56 
    5754/** @}
    5855 */
  • uspace/drv/fb/amdm37x_dispc/main.c

    r74db5a1 r9cc4b2b4  
    6262                return ENOMEM;
    6363        }
     64
     65        /* Hw part */
    6466        amdm37x_dispc_t *dispc =
    65             ddf_fun_data_alloc(fun, sizeof(amdm37x_dispc_t));
     67            ddf_dev_data_alloc(dev, sizeof(amdm37x_dispc_t));
    6668        if (!dispc) {
    6769                ddf_log_error("Failed to allocate dispc structure\n");
     
    6971                return ENOMEM;
    7072        }
    71         ddf_fun_set_ops(fun, &graph_fun_ops);
     73
    7274        int ret = amdm37x_dispc_init(dispc);
    7375        if (ret != EOK) {
     
    7678                return ret;
    7779        }
     80
     81        /* Visualizer part */
     82        visualizer_t *vis = ddf_fun_data_alloc(fun, sizeof(visualizer_t));
     83        if (!vis) {
     84                ddf_log_error("Failed to allocate visualizer structure\n");
     85                ddf_fun_destroy(fun);
     86                return ENOMEM;
     87        }
     88
     89        graph_init_visualizer(vis);
     90        vis->def_mode_idx = 0; // TODO: What is this? Why is this not handled
     91                               // via init?
     92        vis->ops = amdm37x_dispc_vis_ops;
     93        vis->dev_ctx = dispc;
     94        vis->reg_svc_handle = ddf_fun_get_handle(fun);
     95
     96        ddf_fun_set_ops(fun, &graph_fun_ops);
    7897        ret = ddf_fun_bind(fun);
    7998        if (ret != EOK) {
     
    83102                return ret;
    84103        }
     104        ddf_fun_add_to_category(fun, "visualizer");
    85105        return EOK;
    86106}
Note: See TracChangeset for help on using the changeset viewer.