Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Enumerations | Functions
dispc.c File Reference
#include <linux/kernel.h>
#include <linux/dma-mapping.h>
#include <linux/vmalloc.h>
#include <linux/export.h>
#include <linux/clk.h>
#include <linux/io.h>
#include <linux/jiffies.h>
#include <linux/seq_file.h>
#include <linux/delay.h>
#include <linux/workqueue.h>
#include <linux/hardirq.h>
#include <linux/interrupt.h>
#include <linux/platform_device.h>
#include <linux/pm_runtime.h>
#include <plat/cpu.h>
#include <video/omapdss.h>
#include "dss.h"
#include "dss_features.h"
#include "dispc.h"

Go to the source code of this file.

Data Structures

struct  omap_dispc_isr_data
 
struct  dispc_irq_stats
 
struct  dispc_features
 
struct  color_conv_coef
 

Macros

#define DSS_SUBSYS_NAME   "DISPC"
 
#define DISPC_SZ_REGS   SZ_4K
 
#define DISPC_IRQ_MASK_ERROR
 
#define DISPC_MAX_NR_ISRS   8
 
#define REG_GET(idx, start, end)   FLD_GET(dispc_read_reg(idx), start, end)
 
#define REG_FLD_MOD(idx, val, start, end)   dispc_write_reg(idx, FLD_MOD(dispc_read_reg(idx), val, start, end))
 
#define DISPC_MAX_NR_FIFOS   5
 
#define SR(reg)   dispc.ctx[DISPC_##reg / sizeof(u32)] = dispc_read_reg(DISPC_##reg)
 
#define RR(reg)   dispc_write_reg(DISPC_##reg, dispc.ctx[DISPC_##reg / sizeof(u32)])
 
#define CVAL(x, y)   (FLD_VAL(x, 26, 16) | FLD_VAL(y, 10, 0))
 
#define DUMPREG(r)   seq_printf(s, "%-50s %08x\n", #r, dispc_read_reg(r))
 
#define DISPC_REG(i, name)   name(i)
 
#define DUMPREG(i, r)
 
#define DISPC_REG(plane, name, i)   name(plane, i)
 
#define DUMPREG(plane, name, i)
 

Enumerations

enum  omap_burst_size { BURST_SIZE_X2 = 0, BURST_SIZE_X4 = 1, BURST_SIZE_X8 = 2 }
 
enum  omap_color_component { DISPC_COLOR_COMPONENT_RGB_Y = 1 << 0, DISPC_COLOR_COMPONENT_UV = 1 << 1 }
 
enum  mgr_reg_fields {
  DISPC_MGR_FLD_ENABLE, DISPC_MGR_FLD_STNTFT, DISPC_MGR_FLD_GO, DISPC_MGR_FLD_TFTDATALINES,
  DISPC_MGR_FLD_STALLMODE, DISPC_MGR_FLD_TCKENABLE, DISPC_MGR_FLD_TCKSELECTION, DISPC_MGR_FLD_CPR,
  DISPC_MGR_FLD_FIFOHANDCHECK, DISPC_MGR_FLD_NUM
}
 

Functions

int dispc_runtime_get (void)
 
void dispc_runtime_put (void)
 
u32 dispc_mgr_get_vsync_irq (enum omap_channel channel)
 
u32 dispc_mgr_get_framedone_irq (enum omap_channel channel)
 
u32 dispc_wb_get_framedone_irq (void)
 
bool dispc_mgr_go_busy (enum omap_channel channel)
 
void dispc_mgr_go (enum omap_channel channel)
 
bool dispc_wb_go_busy (void)
 
void dispc_wb_go (void)
 
void dispc_ovl_set_channel_out (enum omap_plane plane, enum omap_channel channel)
 
void dispc_wb_set_channel_in (enum dss_writeback_channel channel)
 
void dispc_enable_gamma_table (bool enable)
 
void dispc_ovl_set_fifo_threshold (enum omap_plane plane, u32 low, u32 high)
 
void dispc_enable_fifomerge (bool enable)
 
void dispc_ovl_compute_fifo_thresholds (enum omap_plane plane, u32 *fifo_low, u32 *fifo_high, bool use_fifomerge, bool manual_update)
 
int dispc_ovl_setup (enum omap_plane plane, const struct omap_overlay_info *oi, bool replication, const struct omap_video_timings *mgr_timings, bool mem_to_mem)
 
int dispc_wb_setup (const struct omap_dss_writeback_info *wi, bool mem_to_mem, const struct omap_video_timings *mgr_timings)
 
int dispc_ovl_enable (enum omap_plane plane, bool enable)
 
bool dispc_mgr_is_enabled (enum omap_channel channel)
 
void dispc_mgr_enable (enum omap_channel channel, bool enable)
 
void dispc_wb_enable (bool enable)
 
bool dispc_wb_is_enabled (void)
 
void dispc_lcd_enable_signal_polarity (bool act_high)
 
void dispc_lcd_enable_signal (bool enable)
 
void dispc_pck_free_enable (bool enable)
 
void dispc_mgr_enable_fifohandcheck (enum omap_channel channel, bool enable)
 
void dispc_mgr_set_lcd_type_tft (enum omap_channel channel)
 
void dispc_set_loadmode (enum omap_dss_load_mode mode)
 
void dispc_mgr_setup (enum omap_channel channel, struct omap_overlay_manager_info *info)
 
void dispc_mgr_set_tft_data_lines (enum omap_channel channel, u8 data_lines)
 
void dispc_mgr_set_io_pad_mode (enum dss_io_pad_mode mode)
 
void dispc_mgr_enable_stallmode (enum omap_channel channel, bool enable)
 
bool dispc_mgr_timings_ok (enum omap_channel channel, const struct omap_video_timings *timings)
 
void dispc_mgr_set_timings (enum omap_channel channel, struct omap_video_timings *timings)
 
unsigned long dispc_fclk_rate (void)
 
unsigned long dispc_mgr_lclk_rate (enum omap_channel channel)
 
unsigned long dispc_mgr_pclk_rate (enum omap_channel channel)
 
unsigned long dispc_core_clk_rate (void)
 
void dispc_dump_clocks (struct seq_file *s)
 
void dispc_find_clk_divs (unsigned long req_pck, unsigned long fck, struct dispc_clock_info *cinfo)
 
int dispc_calc_clock_rates (unsigned long dispc_fclk_rate, struct dispc_clock_info *cinfo)
 
void dispc_mgr_set_clock_div (enum omap_channel channel, struct dispc_clock_info *cinfo)
 
int dispc_mgr_get_clock_div (enum omap_channel channel, struct dispc_clock_info *cinfo)
 
int omap_dispc_register_isr (omap_dispc_isr_t isr, void *arg, u32 mask)
 
 EXPORT_SYMBOL (omap_dispc_register_isr)
 
int omap_dispc_unregister_isr (omap_dispc_isr_t isr, void *arg, u32 mask)
 
 EXPORT_SYMBOL (omap_dispc_unregister_isr)
 
int omap_dispc_wait_for_irq_timeout (u32 irqmask, unsigned long timeout)
 
int omap_dispc_wait_for_irq_interruptible_timeout (u32 irqmask, unsigned long timeout)
 
void dispc_enable_sidle (void)
 
void dispc_disable_sidle (void)
 
int __init dispc_init_platform_driver (void)
 
void __exit dispc_uninit_platform_driver (void)
 

Macro Definition Documentation

#define CVAL (   x,
  y 
)    (FLD_VAL(x, 26, 16) | FLD_VAL(y, 10, 0))
#define DISPC_IRQ_MASK_ERROR
Value:
DISPC_IRQ_OCP_ERR | \
DISPC_IRQ_VID1_FIFO_UNDERFLOW | \
DISPC_IRQ_VID2_FIFO_UNDERFLOW | \
DISPC_IRQ_SYNC_LOST | \
DISPC_IRQ_SYNC_LOST_DIGIT)

Definition at line 51 of file dispc.c.

#define DISPC_MAX_NR_FIFOS   5

Definition at line 106 of file dispc.c.

#define DISPC_MAX_NR_ISRS   8

Definition at line 58 of file dispc.c.

#define DISPC_REG (   i,
  name 
)    name(i)
#define DISPC_REG (   plane,
  name,
  i 
)    name(plane, i)
#define DISPC_SZ_REGS   SZ_4K

Definition at line 49 of file dispc.c.

#define DSS_SUBSYS_NAME   "DISPC"

Definition at line 23 of file dispc.c.

#define DUMPREG (   r)    seq_printf(s, "%-50s %08x\n", #r, dispc_read_reg(r))
#define DUMPREG (   i,
  r 
)
Value:
seq_printf(s, "%s(%s)%*s %08x\n", #r, p_names[i], \
48 - strlen(#r) - strlen(p_names[i]), " ", \
dispc_read_reg(DISPC_REG(i, r)))
#define DUMPREG (   plane,
  name,
  i 
)
Value:
seq_printf(s, "%s_%d(%s)%*s %08x\n", #name, i, p_names[plane], \
46 - strlen(#name) - strlen(p_names[plane]), " ", \
dispc_read_reg(DISPC_REG(plane, name, i)))
#define REG_FLD_MOD (   idx,
  val,
  start,
  end 
)    dispc_write_reg(idx, FLD_MOD(dispc_read_reg(idx), val, start, end))

Definition at line 75 of file dispc.c.

#define REG_GET (   idx,
  start,
  end 
)    FLD_GET(dispc_read_reg(idx), start, end)

Definition at line 72 of file dispc.c.

#define RR (   reg)    dispc_write_reg(DISPC_##reg, dispc.ctx[DISPC_##reg / sizeof(u32)])

Definition at line 274 of file dispc.c.

#define SR (   reg)    dispc.ctx[DISPC_##reg / sizeof(u32)] = dispc_read_reg(DISPC_##reg)

Definition at line 272 of file dispc.c.

Enumeration Type Documentation

Enumerator:
DISPC_MGR_FLD_ENABLE 
DISPC_MGR_FLD_STNTFT 
DISPC_MGR_FLD_GO 
DISPC_MGR_FLD_TFTDATALINES 
DISPC_MGR_FLD_STALLMODE 
DISPC_MGR_FLD_TCKENABLE 
DISPC_MGR_FLD_TCKSELECTION 
DISPC_MGR_FLD_CPR 
DISPC_MGR_FLD_FIFOHANDCHECK 
DISPC_MGR_FLD_NUM 

Definition at line 150 of file dispc.c.

Enumerator:
BURST_SIZE_X2 
BURST_SIZE_X4 
BURST_SIZE_X8 

Definition at line 66 of file dispc.c.

Enumerator:
DISPC_COLOR_COMPONENT_RGB_Y 
DISPC_COLOR_COMPONENT_UV 

Definition at line 138 of file dispc.c.

Function Documentation

int dispc_calc_clock_rates ( unsigned long  dispc_fclk_rate,
struct dispc_clock_info cinfo 
)

Definition at line 3521 of file dispc.c.

unsigned long dispc_core_clk_rate ( void  )

Definition at line 3162 of file dispc.c.

void dispc_disable_sidle ( void  )

Definition at line 3963 of file dispc.c.

void dispc_dump_clocks ( struct seq_file s)

Definition at line 3213 of file dispc.c.

void dispc_enable_fifomerge ( bool  enable)

Definition at line 1220 of file dispc.c.

void dispc_enable_gamma_table ( bool  enable)

Definition at line 1056 of file dispc.c.

void dispc_enable_sidle ( void  )

Definition at line 3958 of file dispc.c.

unsigned long dispc_fclk_rate ( void  )

Definition at line 3074 of file dispc.c.

void dispc_find_clk_divs ( unsigned long  req_pck,
unsigned long  fck,
struct dispc_clock_info cinfo 
)

Definition at line 3473 of file dispc.c.

int __init dispc_init_platform_driver ( void  )

Definition at line 4201 of file dispc.c.

void dispc_lcd_enable_signal ( bool  enable)

Definition at line 2780 of file dispc.c.

void dispc_lcd_enable_signal_polarity ( bool  act_high)

Definition at line 2772 of file dispc.c.

void dispc_mgr_enable ( enum omap_channel  channel,
bool  enable 
)

Definition at line 2721 of file dispc.c.

void dispc_mgr_enable_fifohandcheck ( enum omap_channel  channel,
bool  enable 
)

Definition at line 2796 of file dispc.c.

void dispc_mgr_enable_stallmode ( enum omap_channel  channel,
bool  enable 
)

Definition at line 2912 of file dispc.c.

int dispc_mgr_get_clock_div ( enum omap_channel  channel,
struct dispc_clock_info cinfo 
)

Definition at line 3544 of file dispc.c.

u32 dispc_mgr_get_framedone_irq ( enum omap_channel  channel)

Definition at line 541 of file dispc.c.

u32 dispc_mgr_get_vsync_irq ( enum omap_channel  channel)

Definition at line 536 of file dispc.c.

void dispc_mgr_go ( enum omap_channel  channel)

Definition at line 556 of file dispc.c.

bool dispc_mgr_go_busy ( enum omap_channel  channel)

Definition at line 551 of file dispc.c.

bool dispc_mgr_is_enabled ( enum omap_channel  channel)

Definition at line 2716 of file dispc.c.

unsigned long dispc_mgr_lclk_rate ( enum omap_channel  channel)

Definition at line 3099 of file dispc.c.

unsigned long dispc_mgr_pclk_rate ( enum omap_channel  channel)

Definition at line 3130 of file dispc.c.

void dispc_mgr_set_clock_div ( enum omap_channel  channel,
struct dispc_clock_info cinfo 
)

Definition at line 3535 of file dispc.c.

void dispc_mgr_set_io_pad_mode ( enum dss_io_pad_mode  mode)

Definition at line 2883 of file dispc.c.

void dispc_mgr_set_lcd_type_tft ( enum omap_channel  channel)

Definition at line 2802 of file dispc.c.

void dispc_mgr_set_tft_data_lines ( enum omap_channel  channel,
u8  data_lines 
)

Definition at line 2858 of file dispc.c.

void dispc_mgr_set_timings ( enum omap_channel  channel,
struct omap_video_timings timings 
)

Definition at line 3014 of file dispc.c.

void dispc_mgr_setup ( enum omap_channel  channel,
struct omap_overlay_manager_info info 
)

Definition at line 2844 of file dispc.c.

bool dispc_mgr_timings_ok ( enum omap_channel  channel,
const struct omap_video_timings timings 
)

Definition at line 2936 of file dispc.c.

void dispc_ovl_compute_fifo_thresholds ( enum omap_plane  plane,
u32 fifo_low,
u32 fifo_high,
bool  use_fifomerge,
bool  manual_update 
)

Definition at line 1231 of file dispc.c.

int dispc_ovl_enable ( enum omap_plane  plane,
bool  enable 
)

Definition at line 2579 of file dispc.c.

void dispc_ovl_set_channel_out ( enum omap_plane  plane,
enum omap_channel  channel 
)

Definition at line 924 of file dispc.c.

void dispc_ovl_set_fifo_threshold ( enum omap_plane  plane,
u32  low,
u32  high 
)

Definition at line 1191 of file dispc.c.

int dispc_ovl_setup ( enum omap_plane  plane,
const struct omap_overlay_info oi,
bool  replication,
const struct omap_video_timings mgr_timings,
bool  mem_to_mem 
)

Definition at line 2503 of file dispc.c.

void dispc_pck_free_enable ( bool  enable)

Definition at line 2788 of file dispc.c.

int dispc_runtime_get ( void  )

Definition at line 515 of file dispc.c.

void dispc_runtime_put ( void  )

Definition at line 526 of file dispc.c.

void dispc_set_loadmode ( enum omap_dss_load_mode  mode)

Definition at line 2807 of file dispc.c.

void __exit dispc_uninit_platform_driver ( void  )

Definition at line 4206 of file dispc.c.

void dispc_wb_enable ( bool  enable)

Definition at line 2731 of file dispc.c.

u32 dispc_wb_get_framedone_irq ( void  )

Definition at line 546 of file dispc.c.

void dispc_wb_go ( void  )

Definition at line 583 of file dispc.c.

bool dispc_wb_go_busy ( void  )

Definition at line 578 of file dispc.c.

bool dispc_wb_is_enabled ( void  )

Definition at line 2765 of file dispc.c.

void dispc_wb_set_channel_in ( enum dss_writeback_channel  channel)

Definition at line 1022 of file dispc.c.

int dispc_wb_setup ( const struct omap_dss_writeback_info wi,
bool  mem_to_mem,
const struct omap_video_timings mgr_timings 
)

Definition at line 2528 of file dispc.c.

EXPORT_SYMBOL ( omap_dispc_register_isr  )
EXPORT_SYMBOL ( omap_dispc_unregister_isr  )
int omap_dispc_register_isr ( omap_dispc_isr_t  isr,
void arg,
u32  mask 
)

Definition at line 3586 of file dispc.c.

int omap_dispc_unregister_isr ( omap_dispc_isr_t  isr,
void arg,
u32  mask 
)

Definition at line 3640 of file dispc.c.

int omap_dispc_wait_for_irq_interruptible_timeout ( u32  irqmask,
unsigned long  timeout 
)

Definition at line 3902 of file dispc.c.

int omap_dispc_wait_for_irq_timeout ( u32  irqmask,
unsigned long  timeout 
)

Definition at line 3873 of file dispc.c.

Variable Documentation

void __iomem* base

Definition at line 110 of file dispc.c.

Definition at line 128 of file dispc.c.

int ctx_loss_cnt

Definition at line 112 of file dispc.c.

bool ctx_valid

Definition at line 127 of file dispc.c.

struct clk* dss_clk

Definition at line 115 of file dispc.c.

u32 error_irqs

Definition at line 124 of file dispc.c.

struct work_struct error_work

Definition at line 125 of file dispc.c.

Definition at line 130 of file dispc.c.

int fifo_assignment[DISPC_MAX_NR_FIFOS]

Definition at line 119 of file dispc.c.

Definition at line 117 of file dispc.c.

u32 framedone_irq

Definition at line 167 of file dispc.c.

int irq

Definition at line 114 of file dispc.c.

u32 irq_error_mask

Definition at line 122 of file dispc.c.

spinlock_t irq_lock

Definition at line 121 of file dispc.c.

const char* name

Definition at line 165 of file dispc.c.

Definition at line 109 of file dispc.c.

Definition at line 169 of file dispc.c.

Definition at line 123 of file dispc.c.

u32 sync_lost_irq

Definition at line 168 of file dispc.c.

u32 vsync_irq

Definition at line 166 of file dispc.c.