Re: orrery crashing X

2010-11-16 Thread Treviño
Il giorno lun, 15/11/2010 alle 22.15 +0100, Martin Jansa ha scritto:
> Xorg crash fixed
> http://git.openembedded.org/cgit.cgi/openembedded/commit/?id=a02d3d0eefe03576c33294b4201fdbe6bde21cde

Cool! Now also midori doesn't crash any more on tab-switch! :)




___
Openmoko community mailing list
community@lists.openmoko.org
http://lists.openmoko.org/mailman/listinfo/community


Re: orrery crashing X

2010-11-15 Thread Benjamin Deering
Thanks for applying that,

I thought the orrery maintainer would have applied it by now upstream 
too.  When I sent him the patch, he was planning to get a build out that 
weekend.  All of the current orrery development is happening on maemo 
for n900.

I never heard whether is faster to draw each point direct to display, or 
to draw to a buffer and display the buffer.  If my change is slower, and 
you have fixed the stack corruption when lots of events are sent to the 
glamo, then you may not want my patch.

Ben
On 11/15/2010 04:15 PM, Martin Jansa wrote:
> On Thu, Sep 02, 2010 at 08:25:34PM -0400, Benjamin Deering wrote:
>
>> Hello All,
>>
>> I've missed having orrery this summer.  Today I took a look at why it
>> was causing X to crash.  The crash happens when the program calls
>> gdk_draw_point for every star it displays.  I changed my copy to draw
>> all of the stars into a GdkPixbuf, then I copy the GdkPixbuf onto the
>> drawable area.
>>
>> Maybe someone knows why lots of gdk_draw_points would crash X.
>>
>> I think using the GdkPixbuf is faster anyways, so I'll try to add this
>> to the bug posted on the orrery project page.
>>
>> Ben
>>  
> Xorg crash fixed
> http://git.openembedded.org/cgit.cgi/openembedded/commit/?id=a02d3d0eefe03576c33294b4201fdbe6bde21cde
>
> I'll apply your orrery patch too, but pitty that upstream didn't apply it
> (afaik).
>
> Regards,
>


___
Openmoko community mailing list
community@lists.openmoko.org
http://lists.openmoko.org/mailman/listinfo/community


Re: orrery crashing X

2010-11-15 Thread Martin Jansa
On Thu, Sep 02, 2010 at 08:25:34PM -0400, Benjamin Deering wrote:
> Hello All,
> 
> I've missed having orrery this summer.  Today I took a look at why it 
> was causing X to crash.  The crash happens when the program calls 
> gdk_draw_point for every star it displays.  I changed my copy to draw 
> all of the stars into a GdkPixbuf, then I copy the GdkPixbuf onto the 
> drawable area.
> 
> Maybe someone knows why lots of gdk_draw_points would crash X.
> 
> I think using the GdkPixbuf is faster anyways, so I'll try to add this 
> to the bug posted on the orrery project page.
> 
> Ben

Xorg crash fixed
http://git.openembedded.org/cgit.cgi/openembedded/commit/?id=a02d3d0eefe03576c33294b4201fdbe6bde21cde

I'll apply your orrery patch too, but pitty that upstream didn't apply it
(afaik).

Regards,
-- 
Martin 'JaMa' Jansa jabber: martin.ja...@gmail.com

___
Openmoko community mailing list
community@lists.openmoko.org
http://lists.openmoko.org/mailman/listinfo/community


Re: orrery crashing X

2010-09-03 Thread Martix
Hi,
thanks for patch. I think you found two bugs, first in Orrery and
second in X, because it didn't crash several months before (and it
shouldn't). Maybe it's caused by some regression in X or perhaps lots
of gdk_draw_points allocated too much memory and X has been killed by
OOM killer. You can test this condition with swap.

Regards,

Martix

2010/9/3 Benjamin Deering :
> Hello All,
>
> I've missed having orrery this summer.  Today I took a look at why it
> was causing X to crash.  The crash happens when the program calls
> gdk_draw_point for every star it displays.  I changed my copy to draw
> all of the stars into a GdkPixbuf, then I copy the GdkPixbuf onto the
> drawable area.
>
> Maybe someone knows why lots of gdk_draw_points would crash X.
>
> I think using the GdkPixbuf is faster anyways, so I'll try to add this
> to the bug posted on the orrery project page.
>
> Ben
>
>
>
>
> --- orrery.c    2009-11-30 00:59:44.0 -0500
> +++ orrery/orrery.c    2010-09-02 20:16:24.0 -0400
> @@ -1188,6 +1188,7 @@
>        readStarCatalog(fD);
>      showingFaintStars = FALSE;
>    }
> +
>    nDarkGreyPoints = nGreyPoints = nWhitePoints = 0;
>    darkGreyLimit = DARK_GREY_LIMIT/magScale;
>    greyLimit = GREY_LIMIT/magScale;
> @@ -1238,12 +1239,47 @@
>      }
>      currentEntry = currentEntry->forwardPointer;
>    }
> -  if (nDarkGreyPoints > 0)
> -    gdk_draw_points(pixmap, darkGreyGC, darkGreyPoints, nDarkGreyPoints);
> -  if (nGreyPoints > 0)
> -    gdk_draw_points(pixmap, greyGC, greyPoints, nGreyPoints);
> -  if (nWhitePoints > 0)
> -    gdk_draw_points(pixmap, whiteGC, whitePoints, nWhitePoints);
> +  GdkPixbuf* starDrawingBuf = gdk_pixbuf_get_from_drawable( NULL,
> +
>            pixmap,
> +
>            gdk_colormap_get_system()
> +
>            , 0, 0, 0, 0, displayWidth, displayHeight);
> +  g_assert (gdk_pixbuf_get_bits_per_sample (starDrawingBuf) == 8);
> +  guchar* p;
> +  int rowstride = gdk_pixbuf_get_rowstride (starDrawingBuf);
> +  guchar* pixels = gdk_pixbuf_get_pixels (starDrawingBuf);
> +  int n_channels = gdk_pixbuf_get_n_channels (starDrawingBuf);
> +  GdkGCValues starGCval;
> +  GdkColor starColor;
> +  int pointNum;
> +  gdk_gc_get_values(darkGreyGC, &starGCval);
> +  gdk_colormap_query_color( gdk_gc_get_colormap(darkGreyGC),
> starGCval.foreground.pixel, &starColor );
> +  for( pointNum = 0; pointNum < nDarkGreyPoints; pointNum++)
> +  {
> +    p = pixels + darkGreyPoints[pointNum].y * rowstride +
> darkGreyPoints[pointNum].x * n_channels;
> +     p[0] = starColor.red & 0xff;
> +     p[1] = starColor.green & 0xff;
> +     p[2] = starColor.blue & 0xff;
> +  }
> +  gdk_gc_get_values(greyGC, &starGCval);
> +  gdk_colormap_query_color( gdk_gc_get_colormap(greyGC),
> starGCval.foreground.pixel, &starColor );
> +  for( pointNum = 0; pointNum < nGreyPoints; pointNum++)
> +  {
> +    p = pixels + greyPoints[pointNum].y * rowstride +
> greyPoints[pointNum].x * n_channels;
> +     p[0] = starColor.red & 0xff;
> +     p[1] = starColor.green & 0xff;
> +     p[2] = starColor.blue & 0xff;
> +  }
> +  gdk_gc_get_values(whiteGC, &starGCval);
> +  gdk_colormap_query_color( gdk_gc_get_colormap(whiteGC),
> starGCval.foreground.pixel, &starColor );
> +  for( pointNum = 0; pointNum < nWhitePoints; pointNum++)
> +  {
> +    p = pixels + whitePoints[pointNum].y * rowstride +
> whitePoints[pointNum].x * n_channels;
> +     p[0] = starColor.red & 0xff;
> +     p[1] = starColor.green & 0xff;
> +     p[2] = starColor.blue & 0xff;
> +  }
> +  gdk_draw_pixbuf ( pixmap , NULL , starDrawingBuf,
> +            0, 0, 0, 0, displayWidth, displayHeight,
> GDK_RGB_DITHER_NORMAL, 0, 0 ) ;
>  }
>
>  void makeTimeString(char *string)
>
>
> ___
> Openmoko community mailing list
> community@lists.openmoko.org
> http://lists.openmoko.org/mailman/listinfo/community
>

___
Openmoko community mailing list
community@lists.openmoko.org
http://lists.openmoko.org/mailman/listinfo/community


orrery crashing X

2010-09-02 Thread Benjamin Deering
Hello All,

I've missed having orrery this summer.  Today I took a look at why it 
was causing X to crash.  The crash happens when the program calls 
gdk_draw_point for every star it displays.  I changed my copy to draw 
all of the stars into a GdkPixbuf, then I copy the GdkPixbuf onto the 
drawable area.

Maybe someone knows why lots of gdk_draw_points would crash X.

I think using the GdkPixbuf is faster anyways, so I'll try to add this 
to the bug posted on the orrery project page.

Ben




--- orrery.c2009-11-30 00:59:44.0 -0500
+++ orrery/orrery.c2010-09-02 20:16:24.0 -0400
@@ -1188,6 +1188,7 @@
readStarCatalog(fD);
  showingFaintStars = FALSE;
}
+
nDarkGreyPoints = nGreyPoints = nWhitePoints = 0;
darkGreyLimit = DARK_GREY_LIMIT/magScale;
greyLimit = GREY_LIMIT/magScale;
@@ -1238,12 +1239,47 @@
  }
  currentEntry = currentEntry->forwardPointer;
}
-  if (nDarkGreyPoints > 0)
-gdk_draw_points(pixmap, darkGreyGC, darkGreyPoints, nDarkGreyPoints);
-  if (nGreyPoints > 0)
-gdk_draw_points(pixmap, greyGC, greyPoints, nGreyPoints);
-  if (nWhitePoints > 0)
-gdk_draw_points(pixmap, whiteGC, whitePoints, nWhitePoints);
+  GdkPixbuf* starDrawingBuf = gdk_pixbuf_get_from_drawable( NULL,
+  
pixmap,
+  
gdk_colormap_get_system()
+  
, 0, 0, 0, 0, displayWidth, displayHeight);
+  g_assert (gdk_pixbuf_get_bits_per_sample (starDrawingBuf) == 8);
+  guchar* p;
+  int rowstride = gdk_pixbuf_get_rowstride (starDrawingBuf);
+  guchar* pixels = gdk_pixbuf_get_pixels (starDrawingBuf);
+  int n_channels = gdk_pixbuf_get_n_channels (starDrawingBuf);
+  GdkGCValues starGCval;
+  GdkColor starColor;
+  int pointNum;
+  gdk_gc_get_values(darkGreyGC, &starGCval);
+  gdk_colormap_query_color( gdk_gc_get_colormap(darkGreyGC), 
starGCval.foreground.pixel, &starColor );
+  for( pointNum = 0; pointNum < nDarkGreyPoints; pointNum++)
+  {
+p = pixels + darkGreyPoints[pointNum].y * rowstride + 
darkGreyPoints[pointNum].x * n_channels;
+ p[0] = starColor.red & 0xff;
+ p[1] = starColor.green & 0xff;
+ p[2] = starColor.blue & 0xff;
+  }
+  gdk_gc_get_values(greyGC, &starGCval);
+  gdk_colormap_query_color( gdk_gc_get_colormap(greyGC), 
starGCval.foreground.pixel, &starColor );
+  for( pointNum = 0; pointNum < nGreyPoints; pointNum++)
+  {
+p = pixels + greyPoints[pointNum].y * rowstride + 
greyPoints[pointNum].x * n_channels;
+ p[0] = starColor.red & 0xff;
+ p[1] = starColor.green & 0xff;
+ p[2] = starColor.blue & 0xff;
+  }
+  gdk_gc_get_values(whiteGC, &starGCval);
+  gdk_colormap_query_color( gdk_gc_get_colormap(whiteGC), 
starGCval.foreground.pixel, &starColor );
+  for( pointNum = 0; pointNum < nWhitePoints; pointNum++)
+  {
+p = pixels + whitePoints[pointNum].y * rowstride + 
whitePoints[pointNum].x * n_channels;
+ p[0] = starColor.red & 0xff;
+ p[1] = starColor.green & 0xff;
+ p[2] = starColor.blue & 0xff;
+  }
+  gdk_draw_pixbuf ( pixmap , NULL , starDrawingBuf,
+0, 0, 0, 0, displayWidth, displayHeight, 
GDK_RGB_DITHER_NORMAL, 0, 0 ) ;
  }

  void makeTimeString(char *string)


___
Openmoko community mailing list
community@lists.openmoko.org
http://lists.openmoko.org/mailman/listinfo/community