9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: rog@vitanuova.com
To: 9fans@cse.psu.edu
Subject: Re: [9fans] point2rgb and point2rgba
Date: Mon, 31 Jan 2005 20:27:58 +0000	[thread overview]
Message-ID: <b3debcc972f46cefbd1d641a7878caf1@vitanuova.com> (raw)
In-Reply-To: <7871fcf5050131113724b79a68@mail.gmail.com>

> Does the current draw device penalize these operations so much?

i believe so.  (particularly if you're doing lots of small scattered
updates to a largish image).

say you've got some software which maintains its own client-side
bitmap.  for each rectangle to be updated, you've got to copy the bits
for that rectangle into a buffer(*), invoke loadimage, which copies the
data into another buffer (with at least 21 extra), invokes a write
syscall (one for each 64K of data), which copies the data into the destination image.

since the display can be in any channel format, and one generally
wants to avoid code bloat, it's not uncommon to have the destination
image actually be an intermediate image in a known pixel format, which
is then actually copied onto an on-screen image.

if you could get the draw device to create an image to which there was
shared-memory access, all but the last step could be eliminated.
i reckon this could speed things up a lot, but i haven't measured it,
so it's quite possible i'm totally misguided.

(*) one way to eliminate one data copy in the above scenario might be to
give loadimage a "skip" argument (a number of bytes in the data to
skip after each line).  then at least you could do loadimage directly
from the client-side image data. this wouldn't affect the anything
if you're always blitting the whole image.



      parent reply	other threads:[~2005-01-31 20:27 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-01-31 14:54 andrey mirtchovski
2005-01-31 15:01 ` andrey mirtchovski
2005-01-31 18:01 ` Russ Cox
2005-01-31 18:23   ` andrey mirtchovski
2005-01-31 18:26     ` Russ Cox
2005-01-31 18:46       ` rog
2005-01-31 18:47         ` andrey mirtchovski
2005-01-31 18:57           ` Russ Cox
2005-01-31 19:14             ` andrey mirtchovski
2005-01-31 19:19             ` rog
2005-01-31 19:33               ` andrey mirtchovski
2005-01-31 19:37               ` Joel Salomon
2005-01-31 19:48                 ` andrey mirtchovski
2005-01-31 20:27                 ` rog [this message]

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=b3debcc972f46cefbd1d641a7878caf1@vitanuova.com \
    --to=rog@vitanuova.com \
    --cc=9fans@cse.psu.edu \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).