All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Ville Syrjälä" <syrjala@sci.fi>
To: dri-devel@lists.sourceforge.net
Cc: rob.clark@linaro.org
Subject: Re: drm: Branch 'master' - 5 commits
Date: Fri, 6 Apr 2012 00:21:56 +0300	[thread overview]
Message-ID: <20120405212156.GC2316@sci.fi> (raw)
In-Reply-To: <20120403215001.C45FA1004B@kemper.freedesktop.org>

On Tue, Apr 03, 2012 at 02:50:01PM -0700, Rob Clark wrote:
> +		/* just testing a limited # of formats to test single
> +		 * and multi-planar path.. would be nice to add more..
> +		 */
> +		if (!strcmp(p->format_str, "YUYV")) {
> +			pitches[0] = p->w * 2;
> +			offsets[0] = 0;
> +			kms_bo_get_prop(plane_bo, KMS_HANDLE, &handles[0]);
> +
> +			fill422(virtual, 0, p->w, p->h, pitches[0]);
> +
> +			format = DRM_FORMAT_YUYV;
> +		} else if (!strcmp(p->format_str, "NV12")) {
> +			pitches[0] = p->w;
> +			offsets[0] = 0;
> +			kms_bo_get_prop(plane_bo, KMS_HANDLE, &handles[0]);
> +			pitches[1] = p->w;
> +			offsets[1] = p->w * p->h;
> +			kms_bo_get_prop(plane_bo, KMS_HANDLE, &handles[1]);
> +
> +			fill420(virtual, virtual+offsets[1], virtual+offsets[1]+1,
> +					2, 0, p->w, p->h, pitches[0]);
> +
> +			format = DRM_FORMAT_NV12;
> +		} else if (!strcmp(p->format_str, "YV12")) {
> +			pitches[0] = p->w;
> +			offsets[0] = 0;
> +			kms_bo_get_prop(plane_bo, KMS_HANDLE, &handles[0]);
> +			pitches[1] = p->w / 2;
> +			offsets[1] = p->w * p->h;
> +			kms_bo_get_prop(plane_bo, KMS_HANDLE, &handles[1]);
> +			pitches[2] = p->w / 2;
> +			offsets[2] = offsets[1] + (p->w * p->h) / 4;
> +			kms_bo_get_prop(plane_bo, KMS_HANDLE, &handles[1]);
                                                                       ^
Should be '2'. The kernel patch I just posted might have caught this.
OTOH it might not have in case handles[2] contains uninitialized data.

We should add a test that would make sure that passing an invalid bo
handle for any plane would return with an error. The problem is knowing
what exactly is an invalid handle since it's all driver specific.
Perhaps 0xffffffff would be a reasonably safe choice. Hmm, now I wonder
if 0 might actually be a valid handle for some of the current drivers...

There should obviously also be a test that does use separate bos
for reach plane. That should either succeed and produce the correct
result, or the driver should respond with an error at least to the
setplane ioctl. Whether it would allow addfb2 to succeed is a slightly
more complicated matter. I suppose it could be possible that on some
odd hardware some planes would support multiple bos and some would
not. In which case the driver would need to allow the addfb2.

-- 
Ville Syrjälä
syrjala@sci.fi
http://www.sci.fi/~syrjala/

------------------------------------------------------------------------------
Better than sec? Nothing is better than sec when it comes to
monitoring Big Data applications. Try Boundary one-second 
resolution app monitoring today. Free.
http://p.sf.net/sfu/Boundary-dev2dev
--
_______________________________________________
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel

       reply	other threads:[~2012-04-05 21:21 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20120403215001.C45FA1004B@kemper.freedesktop.org>
2012-04-05 21:21 ` Ville Syrjälä [this message]
2012-04-05 23:00   ` drm: Branch 'master' - 5 commits Rob Clark
2012-04-05 23:08   ` Rob Clark

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=20120405212156.GC2316@sci.fi \
    --to=syrjala@sci.fi \
    --cc=dri-devel@lists.sourceforge.net \
    --cc=rob.clark@linaro.org \
    /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.