{
struct vop_device *vop_dev =
container_of(dev_drv, struct vop_device, driver);
+ u64 val;
if (unlikely(!vop_dev->clk_on)) {
pr_info("%s,clk_on = %d\n", __func__, vop_dev->clk_on);
case UPDATE_CABC_PWM:
vop_cfg_done(vop_dev);
break;
+ case SET_DSP_MIRROR:
+ val = V_DSP_X_MIR_EN(dev_drv->cur_screen->x_mirror) |
+ V_DSP_Y_MIR_EN(dev_drv->cur_screen->y_mirror);
+ vop_msk_reg(vop_dev, DSP_CTRL0, val);
+ pr_info("%s: xmirror: %d, ymirror: %d\n",
+ __func__, dev_drv->cur_screen->x_mirror,
+ dev_drv->cur_screen->y_mirror);
+ break;
default:
break;
}
},
};
+static int rk3288_lcdc_extern_func(struct rk_lcdc_driver *dev_drv, int cmd)
+{
+ struct lcdc_device *lcdc_dev =
+ container_of(dev_drv, struct lcdc_device, driver);
+ u32 mask, val;
+
+ if (unlikely(!vop_dev->clk_on)) {
+ pr_info("%s,clk_on = %d\n", __func__, vop_dev->clk_on);
+ return 0;
+ }
+
+ switch (cmd) {
+ case SET_DSP_MIRROR:
+ mask = m_DSP_X_MIR_EN | m_DSP_Y_MIR_EN;
+ val = v_DSP_X_MIR_EN(screen->x_mirror) |
+ v_DSP_Y_MIR_EN(screen->y_mirror);
+ lcdc_msk_reg(lcdc_dev, DSP_CTRL0, mask, val);
+ pr_info("%s: xmirror: %d, ymirror: %d\n",
+ __func__, dev_drv->cur_screen->x_mirror,
+ dev_drv->cur_screen->y_mirror);
+ break;
+ default:
+ break;
+ }
+
+ return 0;
+}
+
static struct rk_lcdc_drv_ops lcdc_drv_ops = {
.open = rk3288_lcdc_open,
.win_direct_en = rk3288_lcdc_win_direct_en,
fps, screen->type, screen->mode.vmode);
}
+static ssize_t set_screen_info(struct device *dev,
+ struct device_attribute *attr,
+ const char *buf, size_t count)
+{
+ struct fb_info *fbi = dev_get_drvdata(dev);
+ struct rk_fb_par *fb_par = (struct rk_fb_par *)fbi->par;
+ struct rk_lcdc_driver *dev_drv = fb_par->lcdc_drv;
+ int xmirror = 0, ymirror = 0, ret = 0, rotate = 0;
+
+ ret = kstrtoint(buf, 0, &rotate);
+ if (ret)
+ return ret;
+ xmirror = !!(rotate & X_MIRROR);
+ ymirror = !!(rotate & Y_MIRROR);
+ dev_drv->cur_screen->x_mirror = xmirror;
+ dev_drv->cur_screen->y_mirror = ymirror;
+ mutex_lock(&dev_drv->output_lock);
+ mutex_lock(&dev_drv->win_config);
+ if (dev_drv->ops->extern_func)
+ dev_drv->ops->extern_func(dev_drv, SET_DSP_MIRROR);
+ mutex_unlock(&dev_drv->win_config);
+ mutex_unlock(&dev_drv->output_lock);
+
+ return count;
+}
+
static ssize_t show_disp_info(struct device *dev,
struct device_attribute *attr, char *buf)
{
__ATTR(disp_info, S_IRUGO, show_disp_info, NULL),
__ATTR(dump_buf, S_IRUGO | S_IWUSR, show_dump_buffer, set_dump_buffer),
__ATTR(dsp_buf, S_IRUGO | S_IWUSR, show_dsp_buffer, set_dsp_buffer),
- __ATTR(screen_info, S_IRUGO, show_screen_info, NULL),
+ __ATTR(screen_info, S_IRUGO | S_IWUSR,
+ show_screen_info, set_screen_info),
__ATTR(dual_mode, S_IRUGO, show_dual_mode, NULL),
__ATTR(enable, S_IRUGO | S_IWUSR, show_fb_state, set_fb_state),
__ATTR(overlay, S_IRUGO | S_IWUSR, show_overlay, set_overlay),