Here are a few updates for the PS3 AV Settings and Frame Buffer Device Drivers,
in response to recent review comments.
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- Sony Network and Software Technology Center Europe (NSCE)
Geert.Uytterhoeven@sonycom.com ------- The Corporate Village, Da Vincilaan 7-D1
Voice +32-2-7008453 Fax +32-2-7008622 ---------------- B-1935 Zaventem, Belgium
-------------------------------------------------------------------------
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
@@ -438,7 +438,7 @@ static int ps3av_set_videomode(void)ps3av_set_av_video_mute(PS3AV_CMD_MUTE_ON);/* wake up ps3avd to do the actual video mode setting */-up(&ps3av.ping);+queue_work(ps3av.wq,&ps3av.work);return0;}
@@ -723,7 +715,7 @@ int ps3av_set_video_mode(u32 id, int boo}/* set videomode */-down(&ps3av.pong);+wait_for_completion(&ps3av.done);ps3av.ps3av_mode_old=ps3av.ps3av_mode;ps3av.ps3av_mode=id;if(ps3av_set_videomode())
@@ -879,12 +871,16 @@ static int ps3av_probe(struct ps3_vuart_memset(&ps3av,0,sizeof(ps3av));init_MUTEX(&ps3av.sem);-init_MUTEX_LOCKED(&ps3av.ping);-init_MUTEX(&ps3av.pong);mutex_init(&ps3av.mutex);ps3av.ps3av_mode=0;ps3av.dev=dev;-kernel_thread(ps3avd,&ps3av,CLONE_KERNEL);++INIT_WORK(&ps3av.work,ps3avd);+init_completion(&ps3av.done);+complete(&ps3av.done);+ps3av.wq=create_singlethread_workqueue("ps3avd");+if(!ps3av.wq)+return-ENOMEM;ps3av.available=1;switch(ps3_os_area_get_av_multi_out()){
@@ -924,6 +920,8 @@ static int ps3av_remove(struct ps3_vuart{if(ps3av.available){ps3av_cmd_fin();+if(ps3av.wq)+destroy_workqueue(ps3av.wq);ps3av.available=0;}---ps3-linux-2.6.20.orig/include/asm-powerpc/ps3av.h+++ps3-linux-2.6.20/include/asm-powerpc/ps3av.h
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- Sony Network and Software Technology Center Europe (NSCE)
Geert.Uytterhoeven@sonycom.com ------- The Corporate Village, Da Vincilaan 7-D1
Voice +32-2-7008453 Fax +32-2-7008622 ---------------- B-1935 Zaventem, Belgium
-------------------------------------------------------------------------
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
@@ -805,12 +808,14 @@ static int ps3fb_ioctl(struct fb_info *istaticintps3fbd(void*arg){-daemonize("ps3fbd");-for(;;){-down(&ps3fb.sem);-if(atomic_read(&ps3fb.ext_flip)==0)+interror;++do{+try_to_freeze();+error=down_interruptible(&ps3fb.sem);+if(!error&&!atomic_read(&ps3fb.ext_flip))ps3fb_sync(0);/* single buffer */-}+}while(!kthread_should_stop());return0;}
@@ -1050,9 +1055,17 @@ static int __init ps3fb_probe(struct pla"fb%d: PS3 frame buffer device, using %ld KiB of video memory\n",info->node,ps3fb_videomemory.size>>10);-kernel_thread(ps3fbd,info,CLONE_KERNEL);+ps3fb.task=kthread_run(ps3fbd,info,"ps3fbd");+if(IS_ERR(ps3fb.task)){+retval=PTR_ERR(ps3fb.task);+ps3fb.task=NULL;+gotoerr_unregister_framebuffer;+}+return0;+err_unregister_framebuffer:+unregister_framebuffer(info);err_fb_dealloc:fb_dealloc_cmap(&info->cmap);err_framebuffer_release:
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- Sony Network and Software Technology Center Europe (NSCE)
Geert.Uytterhoeven@sonycom.com ------- The Corporate Village, Da Vincilaan 7-D1
Voice +32-2-7008453 Fax +32-2-7008622 ---------------- B-1935 Zaventem, Belgium
-------------------------------------------------------------------------
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
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- Sony Network and Software Technology Center Europe (NSCE)
Geert.Uytterhoeven@sonycom.com ------- The Corporate Village, Da Vincilaan 7-D1
Voice +32-2-7008453 Fax +32-2-7008622 ---------------- B-1935 Zaventem, Belgium
-------------------------------------------------------------------------
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
ps3av:
- Move the definition of struct ps3av to ps3av.c, as it's used locally only.
- Kill ps3av.sem, use the existing ps3av.mutex instead.
- Make the 512-byte buffer in ps3av_do_pkt() static to reduce stack usage.
Its use is protected by a semaphore anyway.
Signed-off-by: Geert Uytterhoeven <redacted>
---
drivers/ps3/ps3av.c | 29 ++++++++++++++++++++++-------
include/asm-powerpc/ps3av.h | 22 +---------------------
2 files changed, 23 insertions(+), 28 deletions(-)
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- Sony Network and Software Technology Center Europe (NSCE)
Geert.Uytterhoeven@sonycom.com ------- The Corporate Village, Da Vincilaan 7-D1
Voice +32-2-7008453 Fax +32-2-7008622 ---------------- B-1935 Zaventem, Belgium
-------------------------------------------------------------------------
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
From: James Simmons <hidden> Date: 2007-02-15 15:49:05
Andrew please apply.
Acked-By: James Simmons <redacted>
On Thu, 15 Feb 2007, Geert.Uytterhoeven@sonycom.com wrote:
Here are a few updates for the PS3 AV Settings and Frame Buffer Device Drivers,
in response to recent review comments.
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- Sony Network and Software Technology Center Europe (NSCE)
Geert.Uytterhoeven@sonycom.com ------- The Corporate Village, Da Vincilaan 7-D1
Voice +32-2-7008453 Fax +32-2-7008622 ---------------- B-1935 Zaventem, Belgium
-------------------------------------------------------------------------
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
_______________________________________________
Linux-fbdev-devel mailing list
Linux-fbdev-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-fbdev-devel
-------------------------------------------------------------------------
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
From: Christoph Hellwig <hch@lst.de> Date: 2007-02-15 17:50:29
On Thu, Feb 15, 2007 at 04:23:02PM +0100, Geert.Uytterhoeven@sonycom.com wrote:
+ do {
+ try_to_freeze();
+ error = down_interruptible(&ps3fb.sem);
+ if (!error && !atomic_read(&ps3fb.ext_flip))
ps3fb_sync(0); /* single buffer */
this still can deadlock when calling kthread_stop. You really want
to use wake_up_process to kick this thread or use a workqueue.
-------------------------------------------------------------------------
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
From: Andrew Morton <akpm@linux-foundation.org> Date: 2007-02-16 00:59:28
On Fri, 16 Feb 2007 08:43:37 +1100
Benjamin Herrenschmidt [off-list ref] wrote:
On Thu, 2007-02-15 at 18:50 +0100, Christoph Hellwig wrote:
quoted
On Thu, Feb 15, 2007 at 04:23:02PM +0100, Geert.Uytterhoeven@sonycom.com wrote:
quoted
+ do {
+ try_to_freeze();
+ error = down_interruptible(&ps3fb.sem);
+ if (!error && !atomic_read(&ps3fb.ext_flip))
ps3fb_sync(0); /* single buffer */
this still can deadlock when calling kthread_stop. You really want
to use wake_up_process to kick this thread or use a workqueue.
kthread_stop does wake_up_process no ? However, that might not get you
out of interruptible if you don't also have signal_pending...
No, it won't get you out of down_interruptible(). But the code would have
failed trivial testing so perhaps we're missing something.
It seems crufty to use semaphores in this manner. afaict all we're doing
here is poking a kernel thread and asking it to do a bit of work. The
standard way of doing this is to go to sleep on a waitqueue_head.
DEFINE_WAIT(wait);
while (!kthread_should_stop()) {
prepare_to_wait(&wq, &wait, TASK_INTERRUPTIBLE);
if (!atomic_read(&ps3fb.ext_flip))
schedule();
finish_wait(&wq, &wait);
if (!atomic_read(&ps3fb.ext_flip))
WARN_ON(1);
else
ps3fb_sync(0);
}
and, elsewhere,
atomic_inc(&ps3fb.ext_flip);
wake_up_process(my_kernel_therad);
On Fri, 16 Feb 2007 08:43:37 +1100
Benjamin Herrenschmidt [off-list ref] wrote:
quoted
On Thu, 2007-02-15 at 18:50 +0100, Christoph Hellwig wrote:
quoted
On Thu, Feb 15, 2007 at 04:23:02PM +0100, Geert.Uytterhoeven@sonycom.com wrote:
quoted
+ do {
+ try_to_freeze();
+ error = down_interruptible(&ps3fb.sem);
+ if (!error && !atomic_read(&ps3fb.ext_flip))
ps3fb_sync(0); /* single buffer */
this still can deadlock when calling kthread_stop. You really want
to use wake_up_process to kick this thread or use a workqueue.
kthread_stop does wake_up_process no ? However, that might not get you
out of interruptible if you don't also have signal_pending...
No, it won't get you out of down_interruptible(). But the code would have
failed trivial testing so perhaps we're missing something.
As modular ps3fb is not yet supported, this trivial testing is not that
trivial...
It seems crufty to use semaphores in this manner. afaict all we're doing
here is poking a kernel thread and asking it to do a bit of work. The
standard way of doing this is to go to sleep on a waitqueue_head.
DEFINE_WAIT(wait);
while (!kthread_should_stop()) {
prepare_to_wait(&wq, &wait, TASK_INTERRUPTIBLE);
if (!atomic_read(&ps3fb.ext_flip))
schedule();
finish_wait(&wq, &wait);
if (!atomic_read(&ps3fb.ext_flip))
WARN_ON(1);
else
ps3fb_sync(0);
}
and, elsewhere,
atomic_inc(&ps3fb.ext_flip);
wake_up_process(my_kernel_therad);
Thanks! We don't wait on ext_flip, though, but I see your point. Updated patch
will follow.
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- Sony Network and Software Technology Center Europe (NSCE)
Geert.Uytterhoeven@sonycom.com ------- The Corporate Village, Da Vincilaan 7-D1
Voice +32-2-7008453 Fax +32-2-7008622 ---------------- B-1935 Zaventem, Belgium
-------------------------------------------------------------------------
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
ps3fb: Replace the kernel_thread by a proper kthread, which sleeps on a
waitqueue_head.
Signed-off-by: Geert Uytterhoeven <redacted>
---
drivers/video/ps3fb.c | 45 +++++++++++++++++++++++++++++++++++----------
1 files changed, 35 insertions(+), 10 deletions(-)
@@ -805,11 +808,16 @@ static int ps3fb_ioctl(struct fb_info *istaticintps3fbd(void*arg){-daemonize("ps3fbd");-for(;;){-down(&ps3fb.sem);-if(atomic_read(&ps3fb.ext_flip)==0)-ps3fb_sync(0);/* single buffer */+DEFINE_WAIT(wait);+DECLARE_WAIT_QUEUE_HEAD(wq);++while(!kthread_should_stop()){+prepare_to_wait(&wq,&wait,TASK_INTERRUPTIBLE);+if(!ps3fb.is_kicked)+schedule();+finish_wait(&wq,&wait);+ps3fb.is_kicked=0;+ps3fb_sync(0);/* single buffer */}return0;}
@@ -968,6 +979,7 @@ static int __init ps3fb_probe(struct plau64xdr_lpar;intstatus;unsignedlongoffset;+structtask_struct*task;/* get gpu context handle */status=lv1_gpu_memory_allocate(DDR_SIZE,0,0,0,0,
@@ -1050,9 +1062,18 @@ static int __init ps3fb_probe(struct pla"fb%d: PS3 frame buffer device, using %ld KiB of video memory\n",info->node,ps3fb_videomemory.size>>10);-kernel_thread(ps3fbd,info,CLONE_KERNEL);+task=kthread_run(ps3fbd,info,"ps3fbd");+if(IS_ERR(task)){+retval=PTR_ERR(task);+gotoerr_unregister_framebuffer;+}++ps3fb.task=task;+return0;+err_unregister_framebuffer:+unregister_framebuffer(info);err_fb_dealloc:fb_dealloc_cmap(&info->cmap);err_framebuffer_release:
@@ -1195,7 +1221,6 @@ static int __init ps3fb_init(void)atomic_set(&ps3fb.f_count,-1);/* fbcon opens ps3fb */atomic_set(&ps3fb.ext_flip,0);/* for flip with vsync */-init_MUTEX(&ps3fb.sem);init_waitqueue_head(&ps3fb.wait_vsync);ps3fb.num_frames=1;
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- Sony Network and Software Technology Center Europe (NSCE)
Geert.Uytterhoeven@sonycom.com ------- The Corporate Village, Da Vincilaan 7-D1
Voice +32-2-7008453 Fax +32-2-7008622 ---------------- B-1935 Zaventem, Belgium
-------------------------------------------------------------------------
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
@@ -786,8 +783,7 @@ static int ps3fb_ioctl(struct fb_info *icasePS3FB_IOCTL_OFF:DPRINTK("PS3FB_IOCTL_OFF:\n");-if(atomic_read(&ps3fb.ext_flip)>0)-atomic_dec(&ps3fb.ext_flip);+atomic_dec_if_positive(&ps3fb.ext_flip);retval=0;break;
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- Sony Network and Software Technology Center Europe (NSCE)
Geert.Uytterhoeven@sonycom.com ------- The Corporate Village, Da Vincilaan 7-D1
Voice +32-2-7008453 Fax +32-2-7008622 ---------------- B-1935 Zaventem, Belgium
-------------------------------------------------------------------------
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
From: Christoph Hellwig <hch@lst.de> Date: 2007-02-16 16:36:51
On Thu, Feb 15, 2007 at 04:59:16PM -0800, Andrew Morton wrote:
No, it won't get you out of down_interruptible(). But the code would have
failed trivial testing so perhaps we're missing something.
It seems crufty to use semaphores in this manner. afaict all we're doing
here is poking a kernel thread and asking it to do a bit of work. The
standard way of doing this is to go to sleep on a waitqueue_head.
We don't even need the waitqueue. Because it's just a single thread
waiting we can simply use wake_up_process. (.. which you actually
used in the second half of the example, humm..)
-------------------------------------------------------------------------
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
should probably be just:
while (!kthread_should_stop()) {
ps3fb_sync(0);
schedule();
}
given that you don't need a waitqueue and a spurious wakeup here
seems harmless.
-------------------------------------------------------------------------
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
should probably be just:
while (!kthread_should_stop()) {
ps3fb_sync(0);
schedule();
}
given that you don't need a waitqueue and a spurious wakeup here
seems harmless.
Not always. If flipping is disabled, or external flip is enabled, you don't
want a spurious flip.
I'll send a new patch after the weekend.
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- Sony Network and Software Technology Center Europe (NSCE)
Geert.Uytterhoeven@sonycom.com ------- The Corporate Village, Da Vincilaan 7-D1
Voice +32-2-7008453 Fax +32-2-7008622 ---------------- B-1935 Zaventem, Belgium
-------------------------------------------------------------------------
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
should probably be just:
while (!kthread_should_stop()) {
ps3fb_sync(0);
schedule();
}
given that you don't need a waitqueue and a spurious wakeup here
seems harmless.
Not always. If flipping is disabled, or external flip is enabled, you don't
want a spurious flip.
Looks like the waitqueue is needed. Without it ps3fbd runs at 100% CPU and +15
million loops per second.
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- Sony Network and Software Technology Center Europe (NSCE)
Geert.Uytterhoeven@sonycom.com ------- The Corporate Village, Da Vincilaan 7-D1
Voice +32-2-7008453 Fax +32-2-7008622 ---------------- B-1935 Zaventem, Belgium
should probably be just:
while (!kthread_should_stop()) {
ps3fb_sync(0);
schedule();
}
given that you don't need a waitqueue and a spurious wakeup here
seems harmless.
Not always. If flipping is disabled, or external flip is enabled, you don't
want a spurious flip.
Looks like the waitqueue is needed. Without it ps3fbd runs at 100% CPU and +15
million loops per second.
Nope, adding `set_current_state(TASK_INTERRUPTIBLE);' fixed it. Stay tuned for
a new patch.
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- Sony Network and Software Technology Center Europe (NSCE)
Geert.Uytterhoeven@sonycom.com ------- The Corporate Village, Da Vincilaan 7-D1
Voice +32-2-7008453 Fax +32-2-7008622 ---------------- B-1935 Zaventem, Belgium
ps3fb: Replace the kernel_thread and the semaphore by a proper kthread, which is
simply woken up when the screen must be updated
Signed-off-by: Geert Uytterhoeven <redacted>
---
drivers/video/ps3fb.c | 39 ++++++++++++++++++++++++++++++---------
1 files changed, 30 insertions(+), 9 deletions(-)
@@ -968,6 +975,7 @@ static int __init ps3fb_probe(struct plau64xdr_lpar;intstatus;unsignedlongoffset;+structtask_struct*task;/* get gpu context handle */status=lv1_gpu_memory_allocate(DDR_SIZE,0,0,0,0,
@@ -1050,9 +1058,18 @@ static int __init ps3fb_probe(struct pla"fb%d: PS3 frame buffer device, using %ld KiB of video memory\n",info->node,ps3fb_videomemory.size>>10);-kernel_thread(ps3fbd,info,CLONE_KERNEL);+task=kthread_run(ps3fbd,info,"ps3fbd");+if(IS_ERR(task)){+retval=PTR_ERR(task);+gotoerr_unregister_framebuffer;+}++ps3fb.task=task;+return0;+err_unregister_framebuffer:+unregister_framebuffer(info);err_fb_dealloc:fb_dealloc_cmap(&info->cmap);err_framebuffer_release:
@@ -1195,7 +1217,6 @@ static int __init ps3fb_init(void)atomic_set(&ps3fb.f_count,-1);/* fbcon opens ps3fb */atomic_set(&ps3fb.ext_flip,0);/* for flip with vsync */-init_MUTEX(&ps3fb.sem);init_waitqueue_head(&ps3fb.wait_vsync);ps3fb.num_frames=1;
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- Sony Network and Software Technology Center Europe (NSCE)
Geert.Uytterhoeven@sonycom.com ------- The Corporate Village, Da Vincilaan 7-D1
Voice +32-2-7008453 Fax +32-2-7008622 ---------------- B-1935 Zaventem, Belgium
From: Andrew Morton <akpm@linux-foundation.org> Date: 2007-02-21 23:21:00
On Tue, 20 Feb 2007 11:42:04 +0100 (CET)
Geert Uytterhoeven [off-list ref] wrote:
ps3fb: Replace the kernel_thread and the semaphore by a proper kthread, which is
simply woken up when the screen must be updated
<goes off and generates the incremental diff again so we can see what changed>
diff -puN drivers/video/ps3fb.c~ps3fb-thread-updates-2 drivers/video/ps3fb.c
@@ -808,16 +807,13 @@ static int ps3fb_ioctl(struct fb_info *istaticintps3fbd(void*arg){-DEFINE_WAIT(wait);-DECLARE_WAIT_QUEUE_HEAD(wq);-while(!kthread_should_stop()){-prepare_to_wait(&wq,&wait,TASK_INTERRUPTIBLE);-if(!ps3fb.is_kicked)-schedule();-finish_wait(&wq,&wait);-ps3fb.is_kicked=0;-ps3fb_sync(0);/* single buffer */+set_current_state(TASK_INTERRUPTIBLE);+if(ps3fb.is_kicked){+ps3fb.is_kicked=0;+ps3fb_sync(0);/* single buffer */+}+schedule();}return0;}
_
There's still no try_to_freeze() in there. Shouldn't we have one?
-------------------------------------------------------------------------
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
On Tue, 20 Feb 2007 11:42:04 +0100 (CET)
Geert Uytterhoeven [off-list ref] wrote:
quoted
ps3fb: Replace the kernel_thread and the semaphore by a proper kthread, which is
simply woken up when the screen must be updated
<goes off and generates the incremental diff again so we can see what changed>
Sorry, I thought you were just going to replace the patch you already had in
your queue/heap/stack.
quoted hunk
@@ -808,16 +807,13 @@ static int ps3fb_ioctl(struct fb_info *i static int ps3fbd(void *arg) {- DEFINE_WAIT(wait);- DECLARE_WAIT_QUEUE_HEAD(wq);- while (!kthread_should_stop()) {- prepare_to_wait(&wq, &wait, TASK_INTERRUPTIBLE);- if (!ps3fb.is_kicked)- schedule();- finish_wait(&wq, &wait);- ps3fb.is_kicked = 0;- ps3fb_sync(0); /* single buffer */+ set_current_state(TASK_INTERRUPTIBLE);+ if (ps3fb.is_kicked) {+ ps3fb.is_kicked = 0;+ ps3fb_sync(0); /* single buffer */+ }+ schedule(); } return 0; }
_
There's still no try_to_freeze() in there. Shouldn't we have one?
Thanks, I'll add it.
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- Sony Network and Software Technology Center Europe (NSCE)
Geert.Uytterhoeven@sonycom.com ------- The Corporate Village, Da Vincilaan 7-D1
Voice +32-2-7008453 Fax +32-2-7008622 ---------------- B-1935 Zaventem, Belgium
-------------------------------------------------------------------------
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
@@ -808,6 +809,7 @@ static int ps3fb_ioctl(struct fb_info *istaticintps3fbd(void*arg){while(!kthread_should_stop()){+try_to_freeze();set_current_state(TASK_INTERRUPTIBLE);if(ps3fb.is_kicked){ps3fb.is_kicked=0;
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- Sony Network and Software Technology Center Europe (NSCE)
Geert.Uytterhoeven@sonycom.com ------- The Corporate Village, Da Vincilaan 7-D1
Voice +32-2-7008453 Fax +32-2-7008622 ---------------- B-1935 Zaventem, Belgium
-------------------------------------------------------------------------
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
ps3fb: Replace the kernel_thread and the semaphore by a proper kthread, which is
simply woken up when the screen must be updated
Signed-off-by: Geert Uytterhoeven <redacted>
---
drivers/video/ps3fb.c | 41 ++++++++++++++++++++++++++++++++---------
1 files changed, 32 insertions(+), 9 deletions(-)
@@ -968,6 +977,7 @@ static int __init ps3fb_probe(struct plau64xdr_lpar;intstatus;unsignedlongoffset;+structtask_struct*task;/* get gpu context handle */status=lv1_gpu_memory_allocate(DDR_SIZE,0,0,0,0,
@@ -1050,9 +1060,18 @@ static int __init ps3fb_probe(struct pla"fb%d: PS3 frame buffer device, using %ld KiB of video memory\n",info->node,ps3fb_videomemory.size>>10);-kernel_thread(ps3fbd,info,CLONE_KERNEL);+task=kthread_run(ps3fbd,info,"ps3fbd");+if(IS_ERR(task)){+retval=PTR_ERR(task);+gotoerr_unregister_framebuffer;+}++ps3fb.task=task;+return0;+err_unregister_framebuffer:+unregister_framebuffer(info);err_fb_dealloc:fb_dealloc_cmap(&info->cmap);err_framebuffer_release:
@@ -1195,7 +1219,6 @@ static int __init ps3fb_init(void)atomic_set(&ps3fb.f_count,-1);/* fbcon opens ps3fb */atomic_set(&ps3fb.ext_flip,0);/* for flip with vsync */-init_MUTEX(&ps3fb.sem);init_waitqueue_head(&ps3fb.wait_vsync);ps3fb.num_frames=1;
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- Sony Network and Software Technology Center Europe (NSCE)
Geert.Uytterhoeven@sonycom.com ------- The Corporate Village, Da Vincilaan 7-D1
Voice +32-2-7008453 Fax +32-2-7008622 ---------------- B-1935 Zaventem, Belgium
-------------------------------------------------------------------------
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