Hi everybody,

I noticed in DirectFB (I'm working with 1.4.2, but can be found in all
versions) the following lines in src/core/surface_buffer.c (e.g. in function
dfb_surface_buffer_lock) :

 if (accessor == CSAID_CPU) {
          /* If hardware has written or is writing... */
          if (allocation->accessed[CSAID_GPU] & CSAF_WRITE) {
               /* ...wait for the operation to finish. */
                 dfb_gfxcard_sync(); /* TODO: wait for serial instead */

               /* Software read access after hardware write requires flush
of the (bus) read cache. */
               dfb_gfxcard_flush_read_cache();


(*/* TODO: wait for serial instead */* can be found in
src/core/surface_buffer.c and src/core/layer_region.c)

I don't know that much DirectFB internal implementation, but I'm reviewing
an internal patch and I would like to know what you think about it:

Replace the line :
    dfb_gfxcard_sync(); /* TODO: wait for serial instead */
using the following function :
    dfb_gfxcard_wait_serial( const CoreGraphicsSerial *serial )

That gives something like:

E.g. in src/core/surface_buffer.c, dfb_surface_buffer_lock :
  /* Software write access... */
          if (access & CSAF_WRITE) {
               /* ...if hardware has (to) read... */
               if (allocation->accessed[CSAID_GPU] & CSAF_READ) {
                    /* ...wait for the operation to finish. */
                     dfb_gfxcard_wait_serial(&allocation->gfxSerial);

                    /* ...clear hardware read access. */
                    if (!buffer->locked)
                         allocation->accessed[CSAID_GPU] &= ~CSAF_READ;
               }


Where gfxSerial is a CoreGraphicsSerial that has been added to the struct
__DFB_CoreSurfaceAllocation.
So what do you think about that? Can you confirm that this modification is
doing what the TODO was about?

Thanks in advance,

Fabien, Vallée
_______________________________________________
directfb-users mailing list
[email protected]
http://mail.directfb.org/cgi-bin/mailman/listinfo/directfb-users

Reply via email to