Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 156437
b: refs/heads/master
c: 131f734
h: refs/heads/master
i:
  156435: 1ad6cef
v: v3
  • Loading branch information
Linus Torvalds committed Aug 7, 2009
1 parent 1e5301b commit 8ee05ae
Show file tree
Hide file tree
Showing 21 changed files with 287 additions and 181 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 17332925d7b11bb6c2d0c49450ae58dd836005da
refs/heads/master: 131f7340b4f93f9a4a8e5a65abbd352b34d0ee08
2 changes: 1 addition & 1 deletion trunk/drivers/mmc/host/sdhci-of.c
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ static int __devinit sdhci_of_probe(struct of_device *ofdev,
return -ENODEV;

host = sdhci_alloc_host(&ofdev->dev, sizeof(*of_host));
if (!host)
if (IS_ERR(host))
return -ENOMEM;

of_host = sdhci_priv(host);
Expand Down
6 changes: 3 additions & 3 deletions trunk/drivers/video/console/fbcon.c
Original file line number Diff line number Diff line change
Expand Up @@ -1082,7 +1082,6 @@ static void fbcon_init(struct vc_data *vc, int init)
new_rows = FBCON_SWAP(ops->rotate, info->var.yres, info->var.xres);
new_cols /= vc->vc_font.width;
new_rows /= vc->vc_font.height;
vc_resize(vc, new_cols, new_rows);

/*
* We must always set the mode. The mode of the previous console
Expand Down Expand Up @@ -1111,10 +1110,11 @@ static void fbcon_init(struct vc_data *vc, int init)
* vc_{cols,rows}, but we must not set those if we are only
* resizing the console.
*/
if (!init) {
if (init) {
vc->vc_cols = new_cols;
vc->vc_rows = new_rows;
}
} else
vc_resize(vc, new_cols, new_rows);

if (logo)
fbcon_prepare_logo(vc, info, cols, rows, new_cols, new_rows);
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/video/console/fbcon_rotate.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ static inline void rotate_ud(const char *in, char *out, u32 width, u32 height)
width = (width + 7) & ~7;

for (i = 0; i < height; i++) {
for (j = 0; j < width; j++) {
for (j = 0; j < width - shift; j++) {
if (pattern_test_bit(j, i, width, in))
pattern_set_bit(width - (1 + j + shift),
height - (1 + i),
Expand Down
86 changes: 56 additions & 30 deletions trunk/drivers/video/mx3fb.c
Original file line number Diff line number Diff line change
Expand Up @@ -669,7 +669,8 @@ static uint32_t bpp_to_pixfmt(int bpp)
}

static int mx3fb_blank(int blank, struct fb_info *fbi);
static int mx3fb_map_video_memory(struct fb_info *fbi, unsigned int mem_len);
static int mx3fb_map_video_memory(struct fb_info *fbi, unsigned int mem_len,
bool lock);
static int mx3fb_unmap_video_memory(struct fb_info *fbi);

/**
Expand Down Expand Up @@ -711,12 +712,7 @@ static void mx3fb_dma_done(void *arg)
complete(&mx3_fbi->flip_cmpl);
}

/**
* mx3fb_set_par() - set framebuffer parameters and change the operating mode.
* @fbi: framebuffer information pointer.
* @return: 0 on success or negative error code on failure.
*/
static int mx3fb_set_par(struct fb_info *fbi)
static int __set_par(struct fb_info *fbi, bool lock)
{
u32 mem_len;
struct ipu_di_signal_cfg sig_cfg;
Expand All @@ -727,10 +723,6 @@ static int mx3fb_set_par(struct fb_info *fbi)
struct idmac_video_param *video = &ichan->params.video;
struct scatterlist *sg = mx3_fbi->sg;

dev_dbg(mx3fb->dev, "%s [%c]\n", __func__, list_empty(&ichan->queue) ? '-' : '+');

mutex_lock(&mx3_fbi->mutex);

/* Total cleanup */
if (mx3_fbi->txd)
sdc_disable_channel(mx3_fbi);
Expand All @@ -742,10 +734,8 @@ static int mx3fb_set_par(struct fb_info *fbi)
if (fbi->fix.smem_start)
mx3fb_unmap_video_memory(fbi);

if (mx3fb_map_video_memory(fbi, mem_len) < 0) {
mutex_unlock(&mx3_fbi->mutex);
if (mx3fb_map_video_memory(fbi, mem_len, lock) < 0)
return -ENOMEM;
}
}

sg_init_table(&sg[0], 1);
Expand Down Expand Up @@ -791,7 +781,6 @@ static int mx3fb_set_par(struct fb_info *fbi)
fbi->var.vsync_len,
fbi->var.lower_margin +
fbi->var.vsync_len, sig_cfg) != 0) {
mutex_unlock(&mx3_fbi->mutex);
dev_err(fbi->device,
"mx3fb: Error initializing panel.\n");
return -EINVAL;
Expand All @@ -810,9 +799,30 @@ static int mx3fb_set_par(struct fb_info *fbi)
if (mx3_fbi->blank == FB_BLANK_UNBLANK)
sdc_enable_channel(mx3_fbi);

return 0;
}

/**
* mx3fb_set_par() - set framebuffer parameters and change the operating mode.
* @fbi: framebuffer information pointer.
* @return: 0 on success or negative error code on failure.
*/
static int mx3fb_set_par(struct fb_info *fbi)
{
struct mx3fb_info *mx3_fbi = fbi->par;
struct mx3fb_data *mx3fb = mx3_fbi->mx3fb;
struct idmac_channel *ichan = mx3_fbi->idmac_channel;
int ret;

dev_dbg(mx3fb->dev, "%s [%c]\n", __func__, list_empty(&ichan->queue) ? '-' : '+');

mutex_lock(&mx3_fbi->mutex);

ret = __set_par(fbi, true);

mutex_unlock(&mx3_fbi->mutex);

return 0;
return ret;
}

/**
Expand Down Expand Up @@ -966,21 +976,11 @@ static int mx3fb_setcolreg(unsigned int regno, unsigned int red,
return ret;
}

/**
* mx3fb_blank() - blank the display.
*/
static int mx3fb_blank(int blank, struct fb_info *fbi)
static void __blank(int blank, struct fb_info *fbi)
{
struct mx3fb_info *mx3_fbi = fbi->par;
struct mx3fb_data *mx3fb = mx3_fbi->mx3fb;

dev_dbg(fbi->device, "%s, blank = %d, base %p, len %u\n", __func__,
blank, fbi->screen_base, fbi->fix.smem_len);

if (mx3_fbi->blank == blank)
return 0;

mutex_lock(&mx3_fbi->mutex);
mx3_fbi->blank = blank;

switch (blank) {
Expand All @@ -999,6 +999,23 @@ static int mx3fb_blank(int blank, struct fb_info *fbi)
sdc_set_brightness(mx3fb, mx3fb->backlight_level);
break;
}
}

/**
* mx3fb_blank() - blank the display.
*/
static int mx3fb_blank(int blank, struct fb_info *fbi)
{
struct mx3fb_info *mx3_fbi = fbi->par;

dev_dbg(fbi->device, "%s, blank = %d, base %p, len %u\n", __func__,
blank, fbi->screen_base, fbi->fix.smem_len);

if (mx3_fbi->blank == blank)
return 0;

mutex_lock(&mx3_fbi->mutex);
__blank(blank, fbi);
mutex_unlock(&mx3_fbi->mutex);

return 0;
Expand Down Expand Up @@ -1198,14 +1215,16 @@ static int mx3fb_resume(struct platform_device *pdev)
* mx3fb_map_video_memory() - allocates the DRAM memory for the frame buffer.
* @fbi: framebuffer information pointer
* @mem_len: length of mapped memory
* @lock: do not lock during initialisation
* @return: Error code indicating success or failure
*
* This buffer is remapped into a non-cached, non-buffered, memory region to
* allow palette and pixel writes to occur without flushing the cache. Once this
* area is remapped, all virtual memory access to the video memory should occur
* at the new region.
*/
static int mx3fb_map_video_memory(struct fb_info *fbi, unsigned int mem_len)
static int mx3fb_map_video_memory(struct fb_info *fbi, unsigned int mem_len,
bool lock)
{
int retval = 0;
dma_addr_t addr;
Expand All @@ -1221,10 +1240,12 @@ static int mx3fb_map_video_memory(struct fb_info *fbi, unsigned int mem_len)
goto err0;
}

mutex_lock(&fbi->mm_lock);
if (lock)
mutex_lock(&fbi->mm_lock);
fbi->fix.smem_start = addr;
fbi->fix.smem_len = mem_len;
mutex_unlock(&fbi->mm_lock);
if (lock)
mutex_unlock(&fbi->mm_lock);

dev_dbg(fbi->device, "allocated fb @ p=0x%08x, v=0x%p, size=%d.\n",
(uint32_t) fbi->fix.smem_start, fbi->screen_base, fbi->fix.smem_len);
Expand Down Expand Up @@ -1365,6 +1386,11 @@ static int init_fb_chan(struct mx3fb_data *mx3fb, struct idmac_channel *ichan)
init_completion(&mx3fbi->flip_cmpl);
disable_irq(ichan->eof_irq);
dev_dbg(mx3fb->dev, "disabling irq %d\n", ichan->eof_irq);
ret = __set_par(fbi, false);
if (ret < 0)
goto esetpar;

__blank(FB_BLANK_UNBLANK, fbi);

dev_info(dev, "registered, using mode %s\n", fb_mode);

Expand Down
4 changes: 2 additions & 2 deletions trunk/drivers/video/via/hw.c
Original file line number Diff line number Diff line change
Expand Up @@ -2407,14 +2407,14 @@ int viafb_setmode(int vmode_index, int hor_res, int ver_res, int video_bpp,
viafb_dvi_set_mode(viafb_get_mode_index
(viaparinfo->tmds_setting_info->h_active,
viaparinfo->tmds_setting_info->
v_active, 1),
v_active),
video_bpp1, viaparinfo->
tmds_setting_info->iga_path);
} else {
viafb_dvi_set_mode(viafb_get_mode_index
(viaparinfo->tmds_setting_info->h_active,
viaparinfo->
tmds_setting_info->v_active, 0),
tmds_setting_info->v_active),
video_bpp, viaparinfo->
tmds_setting_info->iga_path);
}
Expand Down
15 changes: 3 additions & 12 deletions trunk/drivers/video/via/lcd.c
Original file line number Diff line number Diff line change
Expand Up @@ -580,10 +580,7 @@ static void load_lcd_k400_patch_tbl(int set_hres, int set_vres,
int reg_num = 0;
struct io_reg *lcd_patch_reg = NULL;

if (viaparinfo->lvds_setting_info->iga_path == IGA2)
vmode_index = viafb_get_mode_index(set_hres, set_vres, 1);
else
vmode_index = viafb_get_mode_index(set_hres, set_vres, 0);
vmode_index = viafb_get_mode_index(set_hres, set_vres);
switch (panel_id) {
/* LCD 800x600 */
case LCD_PANEL_ID1_800X600:
Expand Down Expand Up @@ -761,10 +758,7 @@ static void load_lcd_p880_patch_tbl(int set_hres, int set_vres,
int reg_num = 0;
struct io_reg *lcd_patch_reg = NULL;

if (viaparinfo->lvds_setting_info->iga_path == IGA2)
vmode_index = viafb_get_mode_index(set_hres, set_vres, 1);
else
vmode_index = viafb_get_mode_index(set_hres, set_vres, 0);
vmode_index = viafb_get_mode_index(set_hres, set_vres);

switch (panel_id) {
case LCD_PANEL_ID5_1400X1050:
Expand Down Expand Up @@ -832,10 +826,7 @@ static void load_lcd_patch_regs(int set_hres, int set_vres,
{
int vmode_index;

if (viaparinfo->lvds_setting_info->iga_path == IGA2)
vmode_index = viafb_get_mode_index(set_hres, set_vres, 1);
else
vmode_index = viafb_get_mode_index(set_hres, set_vres, 0);
vmode_index = viafb_get_mode_index(set_hres, set_vres);

viafb_unlock_crt();

Expand Down
Loading

0 comments on commit 8ee05ae

Please sign in to comment.