All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCH] cg3: use standard fields for framebuffer physical address and length
@ 2009-05-05  8:45 ` krzysztof.h1
  0 siblings, 0 replies; 6+ messages in thread
From: krzysztof.h1 @ 2009-05-05  8:45 UTC (permalink / raw)
  To: David Miller, krzysztof.h1, linux-fbdev-devel, sparclinux

David Miller napisa³(a):
> From: Krzysztof Helt >krzysztof.h1@poczta.fm>
> Date: Mon, 4 May 2009 22:37:46 +0200
> 
> > Use standard fields fbinfo.fix.smem_start and fbinfo.fix.smem_len
> > for physical address and length of framebuffer.
> > 
> > This also fixes output of the 'fbset -i' command - address and length 
> > of the framebuffer is displayed correctly.
> > 
> > Signed-off-by: Krzysztof Helt >krzysztof.h1@wp.pl>
> 
> I think this is not appropriate.
> 
> The "physical address" of these framebuffers is composed of
> two values, the 32-bit physical offset and the "which_io"
> value.  The full physical I/O address is 36 bits.
> 
> Considering either seperately makes no sense.  And adjustments
> of one make no sense without consideration of the other.
> 
> 

I see. However, there is no adjustment to the smem_start outside 
the driver. It is used only to be displayed by the fbset (which is
general and does not understand the IO spaces).
Another usage is inside the fb_mmap but only if there is no local
fb_mmap function defined by the driver. It is not a case for all sbus 
drivers.

Regards,
Krzysztof



----------------------------------------------------------------------
Wygraj wycieczke do Eurodisneylandu!
Sprawdz >> http://link.interia.pl/f2153

--
To unsubscribe from this list: send the line "unsubscribe sparclinux" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] cg3: use standard fields for framebuffer physical address and length
@ 2009-05-05  8:45 ` krzysztof.h1
  0 siblings, 0 replies; 6+ messages in thread
From: krzysztof.h1 @ 2009-05-05  8:45 UTC (permalink / raw)
  To: David Miller, krzysztof.h1, linux-fbdev-devel, sparclinux

David Miller napisa³(a):
> From: Krzysztof Helt >krzysztof.h1@poczta.fm>
> Date: Mon, 4 May 2009 22:37:46 +0200
> 
> > Use standard fields fbinfo.fix.smem_start and fbinfo.fix.smem_len
> > for physical address and length of framebuffer.
> > 
> > This also fixes output of the 'fbset -i' command - address and length 
> > of the framebuffer is displayed correctly.
> > 
> > Signed-off-by: Krzysztof Helt >krzysztof.h1@wp.pl>
> 
> I think this is not appropriate.
> 
> The "physical address" of these framebuffers is composed of
> two values, the 32-bit physical offset and the "which_io"
> value.  The full physical I/O address is 36 bits.
> 
> Considering either seperately makes no sense.  And adjustments
> of one make no sense without consideration of the other.
> 
> 

I see. However, there is no adjustment to the smem_start outside 
the driver. It is used only to be displayed by the fbset (which is
general and does not understand the IO spaces).
Another usage is inside the fb_mmap but only if there is no local
fb_mmap function defined by the driver. It is not a case for all sbus 
drivers.

Regards,
Krzysztof



----------------------------------------------------------------------
Wygraj wycieczke do Eurodisneylandu!
Sprawdz >> http://link.interia.pl/f2153


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] cg3: use standard fields for framebuffer physical address and length
  2009-05-05  8:45 ` krzysztof.h1
@ 2009-05-07 18:42   ` David Miller
  -1 siblings, 0 replies; 6+ messages in thread
From: David Miller @ 2009-05-07 18:42 UTC (permalink / raw)
  To: krzysztof.h1; +Cc: linux-fbdev-devel, sparclinux

From: krzysztof.h1@poczta.fm
Date: 05 May 2009 10:45:05 +0200

> However, there is no adjustment to the smem_start outside the
> driver. It is used only to be displayed by the fbset (which is
> general and does not understand the IO spaces).  Another usage is
> inside the fb_mmap but only if there is no local fb_mmap function
> defined by the driver. It is not a case for all sbus drivers.

Good point, OK, I'm fine with these changes:

Acked-by: David S. Miller <davem@davemloft.net>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] cg3: use standard fields for framebuffer physical
@ 2009-05-07 18:42   ` David Miller
  0 siblings, 0 replies; 6+ messages in thread
From: David Miller @ 2009-05-07 18:42 UTC (permalink / raw)
  To: krzysztof.h1; +Cc: linux-fbdev-devel, sparclinux

From: krzysztof.h1@poczta.fm
Date: 05 May 2009 10:45:05 +0200

> However, there is no adjustment to the smem_start outside the
> driver. It is used only to be displayed by the fbset (which is
> general and does not understand the IO spaces).  Another usage is
> inside the fb_mmap but only if there is no local fb_mmap function
> defined by the driver. It is not a case for all sbus drivers.

Good point, OK, I'm fine with these changes:

Acked-by: David S. Miller <davem@davemloft.net>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] cg3: use standard fields for framebuffer physical address and length
  2009-05-04 20:37 [PATCH] cg3: use standard fields for framebuffer physical address and length Krzysztof Helt
@ 2009-05-04 21:08 ` David Miller
  0 siblings, 0 replies; 6+ messages in thread
From: David Miller @ 2009-05-04 21:08 UTC (permalink / raw)
  To: krzysztof.h1; +Cc: linux-fbdev-devel, sparclinux

From: Krzysztof Helt <krzysztof.h1@poczta.fm>
Date: Mon, 4 May 2009 22:37:46 +0200

> Use standard fields fbinfo.fix.smem_start and fbinfo.fix.smem_len
> for physical address and length of framebuffer.
> 
> This also fixes output of the 'fbset -i' command - address and length 
> of the framebuffer is displayed correctly.
> 
> Signed-off-by: Krzysztof Helt <krzysztof.h1@wp.pl>

I think this is not appropriate.

The "physical address" of these framebuffers is composed of
two values, the 32-bit physical offset and the "which_io"
value.  The full physical I/O address is 36 bits.

Considering either seperately makes no sense.  And adjustments
of one make no sense without consideration of the other.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH] cg3: use standard fields for framebuffer physical address and length
@ 2009-05-04 20:37 Krzysztof Helt
  2009-05-04 21:08 ` David Miller
  0 siblings, 1 reply; 6+ messages in thread
From: Krzysztof Helt @ 2009-05-04 20:37 UTC (permalink / raw)
  To: Linux-fbdev-devel, sparclinux

From: Krzysztof Helt <krzysztof.h1@wp.pl>

Use standard fields fbinfo.fix.smem_start and fbinfo.fix.smem_len
for physical address and length of framebuffer.

This also fixes output of the 'fbset -i' command - address and length 
of the framebuffer is displayed correctly.

Signed-off-by: Krzysztof Helt <krzysztof.h1@wp.pl>
---

diff -urp linux-orig/drivers/video/cg3.c linux-2.6.30/drivers/video/cg3.c
--- linux-orig/drivers/video/cg3.c	2008-10-13 18:03:36.000000000 +0200
+++ linux-2.6.30/drivers/video/cg3.c	2009-05-04 00:49:43.000000000 +0200
@@ -118,9 +118,7 @@ struct cg3_par {
 #define CG3_FLAG_BLANKED	0x00000001
 #define CG3_FLAG_RDI		0x00000002
 
-	unsigned long		physbase;
 	unsigned long		which_io;
-	unsigned long		fbsize;
 };
 
 /**
@@ -231,17 +229,15 @@ static int cg3_mmap(struct fb_info *info
 	struct cg3_par *par = (struct cg3_par *)info->par;
 
 	return sbusfb_mmap_helper(cg3_mmap_map,
-				  par->physbase, par->fbsize,
+				  info->fix.smem_start, info->fix.smem_len,
 				  par->which_io,
 				  vma);
 }
 
 static int cg3_ioctl(struct fb_info *info, unsigned int cmd, unsigned long arg)
 {
-	struct cg3_par *par = (struct cg3_par *) info->par;
-
 	return sbusfb_ioctl_helper(cmd, arg, info,
-				   FBTYPE_SUN3COLOR, 8, par->fbsize);
+				   FBTYPE_SUN3COLOR, 8, info->fix.smem_len);
 }
 
 /*
@@ -368,7 +364,7 @@ static int __devinit cg3_probe(struct of
 
 	spin_lock_init(&par->lock);
 
-	par->physbase = op->resource[0].start;
+	info->fix.smem_start = op->resource[0].start;
 	par->which_io = op->resource[0].flags & IORESOURCE_BITS;
 
 	sbusfb_fill_var(&info->var, dp, 8);
@@ -382,7 +378,7 @@ static int __devinit cg3_probe(struct of
 
 	linebytes = of_getintprop_default(dp, "linebytes",
 					  info->var.xres);
-	par->fbsize = PAGE_ALIGN(linebytes * info->var.yres);
+	info->fix.smem_len = PAGE_ALIGN(linebytes * info->var.yres);
 
 	par->regs = of_ioremap(&op->resource[0], CG3_REGS_OFFSET,
 			       sizeof(struct cg3_regs), "cg3 regs");
@@ -392,7 +388,7 @@ static int __devinit cg3_probe(struct of
 	info->flags = FBINFO_DEFAULT;
 	info->fbops = &cg3_ops;
 	info->screen_base = of_ioremap(&op->resource[0], CG3_RAM_OFFSET,
-				       par->fbsize, "cg3 ram");
+				       info->fix.smem_len, "cg3 ram");
 	if (!info->screen_base)
 		goto out_unmap_regs;
 
@@ -418,7 +414,7 @@ static int __devinit cg3_probe(struct of
 	dev_set_drvdata(&op->dev, info);
 
 	printk(KERN_INFO "%s: cg3 at %lx:%lx\n",
-	       dp->full_name, par->which_io, par->physbase);
+	       dp->full_name, par->which_io, info->fix.smem_start);
 
 	return 0;
 
@@ -426,7 +422,7 @@ out_dealloc_cmap:
 	fb_dealloc_cmap(&info->cmap);
 
 out_unmap_screen:
-	of_iounmap(&op->resource[0], info->screen_base, par->fbsize);
+	of_iounmap(&op->resource[0], info->screen_base, info->fix.smem_len);
 
 out_unmap_regs:
 	of_iounmap(&op->resource[0], par->regs, sizeof(struct cg3_regs));
@@ -447,7 +443,7 @@ static int __devexit cg3_remove(struct o
 	fb_dealloc_cmap(&info->cmap);
 
 	of_iounmap(&op->resource[0], par->regs, sizeof(struct cg3_regs));
-	of_iounmap(&op->resource[0], info->screen_base, par->fbsize);
+	of_iounmap(&op->resource[0], info->screen_base, info->fix.smem_len);
 
 	framebuffer_release(info);
 

----------------------------------------------------------------------
Wygraj wycieczke do Eurodisneylandu!
Sprawdz >> http://link.interia.pl/f2153


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2009-05-07 18:42 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-05-05  8:45 [PATCH] cg3: use standard fields for framebuffer physical address and length krzysztof.h1
2009-05-05  8:45 ` krzysztof.h1
2009-05-07 18:42 ` David Miller
2009-05-07 18:42   ` [PATCH] cg3: use standard fields for framebuffer physical David Miller
  -- strict thread matches above, loose matches on Subject: below --
2009-05-04 20:37 [PATCH] cg3: use standard fields for framebuffer physical address and length Krzysztof Helt
2009-05-04 21:08 ` David Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.