public inbox for igt-dev@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Imre Deak <imre.deak@intel.com>
To: "Mun, Gwan-gyeong" <gwan-gyeong.mun@intel.com>
Cc: "igt-dev@lists.freedesktop.org" <igt-dev@lists.freedesktop.org>,
	"Heikkila, Juha-pekka" <juha-pekka.heikkila@intel.com>
Subject: Re: [igt-dev] [RESEND,v3 5/5] kms_plane: Add clipping subtests
Date: Mon, 10 Sep 2018 17:05:24 +0300	[thread overview]
Message-ID: <20180910140524.GA13154@ideak-desk.fi.intel.com> (raw)
In-Reply-To: <25b1084a1edae495b87e840a1ef5fb7c190c70d4.camel@intel.com>

On Fri, Sep 07, 2018 at 06:18:43PM +0300, Mun, Gwan-gyeong wrote:
> > > [...]
> > > +static void
> > > +create_fb_for_mode__clipping_display(data_t *data, drmModeModeInfo
> > > *mode,
> > > +				     square_t *clip_squares,
> > > +				     int clip_squares_cnt,
> > > +				     struct igt_fb *fb /* out */)
> > > +{
> > > +	int plane;
> > > +	struct igt_fb plane_fbs[4];
> > > +	unsigned int fb_id;
> > > +	cairo_t *cr;
> > > +	cairo_surface_t *srcs[4];
> > > +
> > > +	fb_id = igt_create_fb(data->drm_fd,
> > > +			      mode->hdisplay, mode->vdisplay,
> > > +			      DRM_FORMAT_XRGB8888,
> > > +			      LOCAL_DRM_FORMAT_MOD_NONE,
> > > +			      fb);
> > > +	igt_assert(fb_id);
> > > +
> > > +	cr = igt_get_cairo_ctx(data->drm_fd, fb);
> > > +	igt_paint_color(cr, 0, 0, mode->hdisplay, mode->vdisplay,
> > > +			0, 0, 0);
> > > +
> > > +	for (plane = 0; plane < clip_squares_cnt; plane++) {
> > > +		create_fb_for_mode__clipping_plane(data, IGT_ROTATION_0,
> > > +						   LOCAL_DRM_FORMAT_MOD_NONE,
> > > +						   DRM_FORMAT_XRGB8888,
> > > +						   clip_squares[plane].size,
> > > +						   &plane_fbs[plane]);
> > > +
> > > +		srcs[plane] = igt_get_cairo_surface(data->drm_fd,
> > > +						   &plane_fbs[plane]);
> > > +		cairo_set_source_surface(cr, srcs[plane],
> > > +					 clip_squares[plane].x,
> > > +					 clip_squares[plane].y);
> > > +		cairo_rectangle(cr,
> > > +				clip_squares[plane].x,
> > > +				clip_squares[plane].y,
> > > +				clip_squares[plane].size,
> > > +				clip_squares[plane].size);
> > > +		cairo_fill(cr);
> > 
> > Could remove the FB, cairo surface already here, so we don't need the
> > array and a second loop below?
> > 
> if we remove the FB and cairo surface here, we will receive SIGABRT
> like this,
> 
> kms_plane: cairo-surface.c:955: cairo_surface_destroy: Assertion
> `CAIRO_REFERENCE_COUNT_HAS_REFERENCE (&surface->ref_count)' failed.
> Received signal SIGABRT.
> 
> And when we call cairo_destroy(), a cairo image surface of igt calls
> blit.

Oops, that's true, I forgot about this oddity in the Cairo API. So your
version is fine.

--Imre
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

  reply	other threads:[~2018-09-10 14:06 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-06  7:23 [igt-dev] [RESEND,v3 0/5] kms_plane: Add clipping subtests Gwan-gyeong Mun
2018-09-06  7:23 ` [igt-dev] [RESEND, v3 1/5] kms_plane: Remove redundant modeset after CRC capture Gwan-gyeong Mun
2018-09-06  7:23 ` [igt-dev] [RESEND, v3 2/5] lib: Export helpers to get rotation/tiling strings Gwan-gyeong Mun
2018-09-06  7:23 ` [igt-dev] [RESEND, v3 3/5] kms_plane: Split helpers creating reference FB and capturing CRC Gwan-gyeong Mun
2018-09-06  7:23 ` [igt-dev] [RESEND, v3 4/5] kms_plane: Add a helper of capturing CRC with commit style Gwan-gyeong Mun
2018-09-06  7:24 ` [igt-dev] [RESEND,v3 5/5] kms_plane: Add clipping subtests Gwan-gyeong Mun
2018-09-07 10:48   ` Imre Deak
2018-09-07 15:18     ` Mun, Gwan-gyeong
2018-09-10 14:05       ` Imre Deak [this message]
2018-09-06  8:28 ` [igt-dev] ✗ Fi.CI.BAT: failure for kms_plane: Add clipping subtests (rev7) Patchwork

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=20180910140524.GA13154@ideak-desk.fi.intel.com \
    --to=imre.deak@intel.com \
    --cc=gwan-gyeong.mun@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=juha-pekka.heikkila@intel.com \
    /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