From: "Antonino A. Daplas" <adaplas@gmail.com>
To: "Orczykowski, Juergen" <juergen.orczykowski@siemens.com>
Cc: Dave Airlie <airlied@gmail.com>, linux-fbdev-devel@lists.sourceforge.net
Subject: Re: bug in intelfbhw.c
Date: Thu, 22 Feb 2007 21:47:58 +0800 [thread overview]
Message-ID: <1172152079.4306.15.camel@daplas> (raw)
In-Reply-To: <3E56BFF2E134A44A98D9FFDB710688DF011D40E1@ERLD151A.ww004.siemens.net>
[-- Attachment #1: Type: text/plain, Size: 212 bytes --]
On Thu, 2007-02-22 at 13:02 +0100, Orczykowski, Juergen wrote:
> Hi Tony,
> Sorry, but in the diff, we miss our (similar) change in the function refresh_ring.
>
Ah, okay.
Dave, here's an updated patch.
Tony
[-- Attachment #2: intelfb_fix_ring_space_bug --]
[-- Type: text/plain, Size: 2329 bytes --]
intelfb: Fix ring space calculation
From: Orczykowski, Juergen <juergen.orczykowski@siemens.com>
If there is less then RING_MIN_FREE available in the ring buffer,
dinfo->ring_space is set to a big value forcing wait_ring to return.
Fix by making ring space = 0 if ring space < RING_MIN_FREE.
Signed-off-by: Antonino Daplas <adaplas@gmail.com>
---
drivers/video/intelfb/intelfbhw.c | 34 +++++++++++++++++++++-------------
1 files changed, 21 insertions(+), 13 deletions(-)
diff --git a/drivers/video/intelfb/intelfbhw.c b/drivers/video/intelfb/intelfbhw.c
index c1eb18b..16bc8d7 100644
--- a/drivers/video/intelfb/intelfbhw.c
+++ b/drivers/video/intelfb/intelfbhw.c
@@ -1428,6 +1428,24 @@ static void refresh_ring(struct intelfb_
static void reset_state(struct intelfb_info *dinfo);
static void do_flush(struct intelfb_info *dinfo);
+static u32 get_ring_space(struct intelfb_info *dinfo)
+{
+ u32 ring_space;
+
+ if (dinfo->ring_tail >= dinfo->ring_head)
+ ring_space = dinfo->ring.size -
+ (dinfo->ring_tail - dinfo->ring_head);
+ else
+ ring_space = dinfo->ring_head - dinfo->ring_tail;
+
+ if (ring_space > RING_MIN_FREE)
+ ring_space -= RING_MIN_FREE;
+ else
+ ring_space = 0;
+
+ return ring_space;
+}
+
static int
wait_ring(struct intelfb_info *dinfo, int n)
{
@@ -1442,13 +1460,8 @@ #endif
end = jiffies + (HZ * 3);
while (dinfo->ring_space < n) {
dinfo->ring_head = INREG(PRI_RING_HEAD) & RING_HEAD_MASK;
- if (dinfo->ring_tail + RING_MIN_FREE < dinfo->ring_head)
- dinfo->ring_space = dinfo->ring_head
- - (dinfo->ring_tail + RING_MIN_FREE);
- else
- dinfo->ring_space = (dinfo->ring.size +
- dinfo->ring_head)
- - (dinfo->ring_tail + RING_MIN_FREE);
+ dinfo->ring_space = get_ring_space(dinfo);
+
if (dinfo->ring_head != last_head) {
end = jiffies + (HZ * 3);
last_head = dinfo->ring_head;
@@ -1513,12 +1526,7 @@ #endif
dinfo->ring_head = INREG(PRI_RING_HEAD) & RING_HEAD_MASK;
dinfo->ring_tail = INREG(PRI_RING_TAIL) & RING_TAIL_MASK;
- if (dinfo->ring_tail + RING_MIN_FREE < dinfo->ring_head)
- dinfo->ring_space = dinfo->ring_head
- - (dinfo->ring_tail + RING_MIN_FREE);
- else
- dinfo->ring_space = (dinfo->ring.size + dinfo->ring_head)
- - (dinfo->ring_tail + RING_MIN_FREE);
+ dinfo->ring_space = get_ring_space(dinfo);
}
static void
[-- Attachment #3: Type: text/plain, Size: 345 bytes --]
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
[-- Attachment #4: Type: text/plain, Size: 182 bytes --]
_______________________________________________
Linux-fbdev-devel mailing list
Linux-fbdev-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-fbdev-devel
next prev parent reply other threads:[~2007-02-22 13:45 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-02-22 8:14 bug in intelfbhw.c Orczykowski, Juergen
2007-02-22 9:02 ` Antonino A. Daplas
2007-02-22 9:27 ` Antonino A. Daplas
2007-02-22 12:02 ` Orczykowski, Juergen
2007-02-22 13:47 ` Antonino A. Daplas [this message]
2007-02-23 0:43 ` Dave Airlie
2007-02-23 0:57 ` Antonino A. Daplas
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1172152079.4306.15.camel@daplas \
--to=adaplas@gmail.com \
--cc=airlied@gmail.com \
--cc=juergen.orczykowski@siemens.com \
--cc=linux-fbdev-devel@lists.sourceforge.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.