/* * Copyright (C) 2011 Texas Instruments * Author: Tomi Valkeinen <tomi.valkeinen@ti.com> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 as published by * the Free Software Foundation. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * more details. * * You should have received a copy of the GNU General Public License along with * this program. If not, see <http://www.gnu.org/licenses/>. */#define DSS_SUBSYS_NAME "APPLY"#include<linux/kernel.h>#include<linux/slab.h>#include<linux/spinlock.h>#include<linux/jiffies.h>#include<video/omapdss.h>#include"dss.h"#include"dss_features.h"/* * We have 4 levels of cache for the dispc settings. First two are in SW and * the latter two in HW. * * set_info() * v * +--------------------+ * | user_info | * +--------------------+ * v * apply() * v * +--------------------+ * | info | * +--------------------+ * v * write_regs() * v * +--------------------+ * | shadow registers | * +--------------------+ * v * VFP or lcd/digit_enable * v * +--------------------+ * | registers | * +--------------------+ */structovl_priv_data{booluser_info_dirty;structomap_overlay_infouser_info;boolinfo_dirty;structomap_overlay_infoinfo;boolshadow_info_dirty;boolextra_info_dirty;boolshadow_extra_info_dirty;boolenabled;enumomap_channelchannel;u32fifo_low,fifo_high;/* * True if overlay is to be enabled. Used to check and calculate configs * for the overlay before it is enabled in the HW. */boolenabling;};structmgr_priv_data{booluser_info_dirty;structomap_overlay_manager_infouser_info;boolinfo_dirty;structomap_overlay_manager_infoinfo;boolshadow_info_dirty;/* If true, GO bit is up and shadow registers cannot be written. * Never true for manual update displays */boolbusy;/* If true, dispc output is enabled */boolupdating;/* If true, a display is enabled using this manager */boolenabled;};staticstruct{structovl_priv_dataovl_priv_data_array[MAX_DSS_OVERLAYS];structmgr_priv_datamgr_priv_data_array[MAX_DSS_MANAGERS];boolirq_enabled;}dss_data;/* protects dss_data */staticspinlock_tdata_lock;/* lock for blocking functions */staticDEFINE_MUTEX(apply_lock);staticDECLARE_COMPLETION(extra_updated_completion);staticvoiddss_register_vsync_isr(void);staticstructovl_priv_data*get_ovl_priv(structomap_overlay*ovl){return&dss_data.ovl_priv_data_array[ovl->id];}staticstructmgr_priv_data*get_mgr_priv(structomap_overlay_manager*mgr){return&dss_data.mgr_priv_data_array[mgr->id];}voiddss_apply_init(void){const