Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
3bb02cb
add Makefile
Oct 30, 2017
d4f7ad8
use urb transfer from udl driver in upstream
Oct 30, 2017
5570ee0
remove EDID filter, for USB 2.0
Oct 30, 2017
b8d543a
add reasonable .gitignore
Oct 30, 2017
5daf340
update Makefile
Oct 30, 2017
3256305
64k URB send
Nov 9, 2017
d18dc76
disbale first EDID, now we read blocks
Nov 25, 2017
8059613
playing with 58k buffer size
Nov 25, 2017
5e02252
add some debug info for usb interrupt
Nov 25, 2017
23dc837
remove unused r1 timing tables
Dec 9, 2017
ab83b11
no use of 8-bit image type
Dec 9, 2017
318193f
add new _fl2000_reg_write_verify()
Dec 9, 2017
3ae9146
add new _fl2000_set_video_mode()
Dec 9, 2017
e79b146
add new _fl2000_set_intrl_ctrl()
Dec 9, 2017
21c9b8f
rename to struct fl2000_timing_entry
Dec 9, 2017
d829dad
remove unused table entries from fpga
Dec 9, 2017
76d150f
remove unused bulk_fpga_pll entry
Dec 9, 2017
a6f9654
remove isochron timng entries
Dec 9, 2017
7a93bd2
remove unused sync and back_porch timings in vr_params
Dec 9, 2017
4227d71
remove unused v_sync_time, v_back_porch
Dec 9, 2017
3660a48
remove unused h_sync_time, h_back_porch
Dec 9, 2017
7a01c46
add new _fl2000_set_video_timing()
Dec 11, 2017
843f252
move _fl2000_hdmi_compliance_tweak() to monitor settings
Dec 12, 2017
8441598
integrate fl2000_hdmi_compliance_tweak()
Dec 17, 2017
d68bc1b
optimize _fl2000_set_video_timing()
Dec 17, 2017
06faba4
move fl2000_dongle_set_params()
Dec 17, 2017
51f55c6
use struct fl2000_timing_entry pointer
Dec 17, 2017
e633283
remove unused iso_reg entry
Dec 18, 2017
25873fc
remove unused ->trasfer_pipe
Dec 27, 2017
d698b44
remove unused end_of_frame_type for URB
Dec 27, 2017
3076571
refactoring fl2000_dongle_u1u2_setup()
Dec 27, 2017
7e3f137
refactoring _fl2000_set_video_mode()
Jan 1, 2018
a9201bd
refactoring _fl2000_set_intrl_ctrl()
Jan 1, 2018
84f24e7
refactoring i2c interrupt init
Jan 3, 2018
e0d941b
use read/write register function for disable hw reset
Jan 3, 2018
c5b9a4c
remove unused ->UsePollingMonitorConnection
Jan 3, 2018
4252af9
refatoring fl2000_dongle_reset()
Jan 3, 2018
c4da512
better USB3 detection
Jan 3, 2018
df95b9e
removed unused speed macros
Jan 3, 2018
f949eab
remove unused Makefile
Jan 20, 2018
7319619
define bitfields in monitor config register REG_OFFSET_8004
Jan 24, 2018
d6ab174
define bitfields in usb control
Jan 24, 2018
b6ad9e6
assume some register names
Jan 25, 2018
99cc42d
more assumtions
Jan 25, 2018
5ad1175
Test image for 800x480 resolution
klogg Feb 16, 2018
5f9187b
Merge branch 'master' of github.com:klogg/FL2000
klogg Feb 20, 2018
59a8548
Cleanup: drop VGA_BIG_TABLE_SIZE
klogg Feb 20, 2018
d1d9cfe
Ignore Eclipse project files
klogg Feb 20, 2018
480c1ba
Remove unused code
klogg Feb 20, 2018
87fe73f
Add files via upload
klogg May 17, 2018
307d32c
Add files via upload
klogg May 17, 2018
5005b17
Delete certs.tar.gz.tar.gz
klogg May 17, 2018
f51e060
Delete certs_new.tar.gz
klogg May 17, 2018
879bc29
Add files via upload
klogg May 17, 2018
0181f48
Delete aos_servicemanager
klogg May 18, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
*.o
*.cmd
*.ko
*.cm
Module.symvers
modules.order
.tmp_versions
fl2000.mod.c
sample/fltes
.cproject
.project
.settings
51 changes: 51 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# Makefile
#
# (c)Copyright 2017, Fresco Logic, Incorporated.
#
# The contents of this file are property of Fresco Logic, Incorporated and are strictly protected
# by Non Disclosure Agreements. Distribution in any form to unauthorized parties is strictly prohibited.
#
# Purpose:
#
# NOTE: DO NOT SEND THIS FILE OUTSIDE OF FRESCO LOGIC.
#

fl2000-y := src/fl2000_module.o \
src/fl2000_bulk.o \
src/fl2000_ioctl.o \
src/fl2000_render.o \
src/fl2000_dev.o \
src/fl2000_dongle.o \
src/fl2000_big_table.o \
src/fl2000_i2c.o \
src/fl2000_register.o \
src/fl2000_monitor.o \
src/fl2000_desc.o \
src/fl2000_interrupt.o \
src/fl2000_compression.o \
src/fl2000_surface.o \
src/fl2000_fops.o \
src/fl2000_hdmi.o \

ifdef CONFIG_USB_FL2000

obj-$(CONFIG_USB_FL2000) := fl2000.o

else

obj-m := fl2000.o

KSRC = /lib/modules/$(shell uname -r)/build

all: modules

modules:
make -C $(KSRC) M=$(PWD) modules

clean:
make -C $(KSRC) M=$(PWD) clean
rm -f Module.symvers

endif


13 changes: 4 additions & 9 deletions sample/Makefile
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
arm_prefix = /opt/hi3798/arm-hisiv200-linux/bin/arm-hisiv200-linux-gnueabi
all:
gcc main.c -o fltes

all: fltest fltest_arm

fltest: main.c
gcc main.c -o fltest

fltest_arm: main.c
$(arm_prefix)-gcc main.c -Xlinker -static -static-libgcc -o fltest_arm
$(arm_prefix)-strip fltest_arm
clean:
rm fltest
Binary file added sample/test_800_480_0.bmp
Binary file not shown.
52 changes: 0 additions & 52 deletions src/Makefile

This file was deleted.

630 changes: 156 additions & 474 deletions src/fl2000_big_table.c

Large diffs are not rendered by default.

9 changes: 2 additions & 7 deletions src/fl2000_big_table.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,11 @@
#ifndef _FL2000_BIG_TABLE_H_
#define _FL2000_BIG_TABLE_H_

#define VGA_BIG_TABLE_SIZE 73

#define VGA_BIG_TABLE_24BIT_R0 0
#define VGA_BIG_TABLE_24BIT_R1 1
#define VGA_BIG_TABLE_16BIT_R0 2
#define VGA_BIG_TABLE_16BIT_R1 3
#define VGA_BIG_TABLE_8BIT_R0 4
#define VGA_BIG_TABLE_8BIT_R1 5

struct resolution_entry const *

struct fl2000_timing_entry const *
fl2000_table_get_entry(
uint32_t table_num,
uint32_t width,
Expand Down
20 changes: 9 additions & 11 deletions src/fl2000_bulk.c
Original file line number Diff line number Diff line change
Expand Up @@ -246,17 +246,15 @@ void fl2000_bulk_prepare_urb(
fl2000_bulk_main_completion,
render_ctx);

if (dev_ctx->vr_params.end_of_frame_type == EOF_ZERO_LENGTH) {
usb_init_urb(render_ctx->zero_length_urb);
usb_fill_bulk_urb(
render_ctx->zero_length_urb,
dev_ctx->usb_dev,
dev_ctx->usb_pipe_bulk_out,
NULL,
0,
fl2000_bulk_zero_length_completion,
render_ctx);
}
usb_init_urb(render_ctx->zero_length_urb);
usb_fill_bulk_urb(
render_ctx->zero_length_urb,
dev_ctx->usb_dev,
dev_ctx->usb_pipe_bulk_out,
NULL,
0,
fl2000_bulk_zero_length_completion,
render_ctx);
}

// eof: fl2000_bulk.c
Expand Down
3 changes: 2 additions & 1 deletion src/fl2000_compression.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,11 @@ GET_BYTES_PER_PIXEL(
uint32_t bytes_per_pixel;

switch (image_type) {
#if 0 /* ULLI : disabled, code is kept here only for consistently */
case OUTPUT_IMAGE_TYPE_RGB_8:
bytes_per_pixel = PIXEL_BYTE_1;
break;

#endif
case OUTPUT_IMAGE_TYPE_RGB_16:
bytes_per_pixel = PIXEL_BYTE_2;
break;
Expand Down
50 changes: 19 additions & 31 deletions src/fl2000_ctx.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,42 +22,22 @@ struct render_ctx;
*/
#define NUM_RENDER_ON_BUS 2

struct resolution_entry
{
struct fl2000_timing_entry {
uint32_t width;
uint32_t height;
uint32_t freq;
uint32_t h_total_time;
uint32_t h_sync_time;
uint32_t h_back_porch;
uint32_t v_total_time;
uint32_t v_sync_time;
uint32_t v_back_porch;
uint32_t isoch_num_of_pkt;
uint32_t isoch_td_size_in_kb;
uint32_t isoch_zero_bytes;
uint32_t itp_per_frame;
uint32_t num_of_idle;
uint32_t td_size;
uint32_t h_sync_reg_1;
uint32_t h_sync_reg_2;
uint32_t v_sync_reg_1;
uint32_t v_sync_reg_2;
uint32_t iso_reg;
uint32_t bulk_fpga_pll;
uint32_t bulk_asic_pll;
uint32_t isoch_fpga_pll;
uint32_t isoch_asic_pll;
uint32_t isoch_fpga_h_sync_reg_1;
uint32_t isoch_asic_h_sync_reg_1;
uint32_t bus_interval_adjust;
};

struct registry
{
uint32_t FilterEdidTableEnable;
uint32_t CurrentNumberOfDevices;
uint32_t UsePollingMonitorConnection;

uint32_t CompressionEnable;
uint32_t Usb2PixelFormatTransformCompressionEnable;
Expand All @@ -69,12 +49,7 @@ struct vr_params
uint32_t height;
uint32_t freq;
uint32_t h_total_time;
uint32_t h_sync_time;
uint32_t h_back_porch;
uint32_t v_total_time;
uint32_t v_sync_time;
uint32_t v_back_porch;
uint32_t trasfer_pipe;

// Compression.
//
Expand All @@ -84,14 +59,9 @@ struct vr_params
uint32_t compression_mask_index_min;
uint32_t compression_mask_index_max;

uint32_t h_sync_reg_1;
uint32_t h_sync_reg_2;
uint32_t v_sync_reg_1;
uint32_t v_sync_reg_2;
uint32_t pll_reg;
uint32_t input_bytes_per_pixel;
uint32_t output_image_type;
uint32_t end_of_frame_type;
uint32_t color_mode_16bit;
};

Expand Down Expand Up @@ -162,6 +132,22 @@ struct render {
uint32_t green_light;
};

struct urb_node {
struct list_head entry;
struct dev_ctx *fl2k;
struct delayed_work release_urb_work;
struct urb *urb;
};

struct urb_list {
struct list_head list;
spinlock_t lock;
struct semaphore limit_sem;
int available;
int count;
size_t size;
};

struct dev_ctx {
struct usb_device* usb_dev;
struct usb_device_descriptor usb_dev_desc;
Expand All @@ -181,6 +167,8 @@ struct dev_ctx {
* __sync_xxx_and_fetch. kind of sucks. we use our sync lock here.
*/
spinlock_t count_lock;
struct urb_list urbs;
atomic_t lost_pixels; /* 1 = a render op failed. Need screen refresh */

/*
* bulk out interface
Expand Down
12 changes: 2 additions & 10 deletions src/fl2000_def.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,28 +71,20 @@
#define EDID_SIZE 128
#define NUM_OF_RENDER_CTX 4

#define IS_DEVICE_USB3LINK(dev_ctx) (USB3_BCD == dev_ctx->usb_dev_desc.bcdUSB)
#define IS_DEVICE_USB2LINK(dev_ctx) (!IS_DEVICE_USB3LINK(dev_ctx))

#if 0
#define OUTPUT_IMAGE_TYPE_RGB_8 0
#endif
#define OUTPUT_IMAGE_TYPE_RGB_16 1
#define OUTPUT_IMAGE_TYPE_RGB_24 2

#define VR_USB_LINKUP_TYPE_NONE 0
#define VR_USB_LINKUP_TYPE_USB2 1
#define VR_USB_LINKUP_TYPE_USB3 2

#define VR_TRANSFER_PIPE_BULK 0
#define VR_TRANSFER_PIPE_ISOCH 1
#define VR_TRANSFER_PIPE_MAX 2

#define PIXEL_BYTE_1 1
#define PIXEL_BYTE_2 2
#define PIXEL_BYTE_3 3

#define EOF_PENDING_BIT 0
#define EOF_ZERO_LENGTH 1

#define VR_16_BIT_COLOR_MODE_565 0
#define VR_16_BIT_COLOR_MODE_555 1

Expand Down
Loading