lib: move frame assembling routines into a separate file and make them usable by non-aes drivers

Frame assembling routines are not aes-specific, so move them into a separate file
and add an accessor for peeking a pixel.
This commit is contained in:
Vasily Khoruzhick
2015-12-16 13:24:38 -08:00
parent 6664f87d8f
commit e40f7bd1f7
12 changed files with 422 additions and 302 deletions
+12 -2
View File
@@ -28,12 +28,22 @@
#include <fp_internal.h>
#include <assembling.h>
#include <aeslib.h>
#include "aesx660.h"
#include "aes1660.h"
#include "driver_ids.h"
#define FRAME_WIDTH 128
#define SCALE_FACTOR 2
#define IMAGE_WIDTH (FRAME_WIDTH + (FRAME_WIDTH / 2))
static struct fpi_frame_asmbl_ctx assembling_ctx = {
.frame_width = FRAME_WIDTH,
.frame_height = AESX660_FRAME_HEIGHT,
.image_width = IMAGE_WIDTH,
.get_pixel = aes_get_pixel,
};
static int dev_init(struct fp_img_dev *dev, unsigned long driver_data)
{
@@ -55,7 +65,7 @@ static int dev_init(struct fp_img_dev *dev, unsigned long driver_data)
aesdev->init_seqs_len[1] = array_n_elements(aes1660_init_2);
aesdev->start_imaging_cmd = (unsigned char *)aes1660_start_imaging_cmd;
aesdev->start_imaging_cmd_len = sizeof(aes1660_start_imaging_cmd);
aesdev->frame_width = FRAME_WIDTH;
aesdev->assembling_ctx = &assembling_ctx;
aesdev->extra_img_flags = FP_IMG_PARTIAL;
fpi_imgdev_open_complete(dev, 0);