From: Gabriel Krisman Bertazi <krisman@collabora.co.uk>
To: Varad Gautam <varadgautam@gmail.com>
Cc: Varad Gautam <varad.gautam@collabora.com>,
dri-devel@lists.freedesktop.org
Subject: Re: [PATCH 01/14] drm/cirrus: split out bo unpinning from cirrus_bo_push_sysram
Date: Mon, 04 Sep 2017 07:41:21 -0300 [thread overview]
Message-ID: <87lgluu4oe.fsf@dilma.collabora.co.uk> (raw)
In-Reply-To: <20170818154919.18607-2-varadgautam@gmail.com> (Varad Gautam's message of "Fri, 18 Aug 2017 21:19:06 +0530")
Varad Gautam <varadgautam@gmail.com> writes:
> int cirrus_bo_push_sysram(struct cirrus_bo *bo)
> {
> int i, ret;
> - if (!bo->pin_count) {
> +
> + ret = cirrus_bo_reserve(bo, false);
> + if (ret)
> + return ret;
> +
> + if (bo->pin_count) {
> DRM_ERROR("unpin bad %p\n", bo);
> - return 0;
> + goto out;
> }
> - bo->pin_count--;
> - if (bo->pin_count)
> - return 0;
Can you adjust this to also use your version of cirrus_bo_unpin()?
Also, If I'm not mistaken, this hunk unbalances pin_count, since you
no longer decrement it after unpinning.
>
> if (bo->kmap.virtual)
> ttm_bo_kunmap(&bo->kmap);
> @@ -400,9 +432,12 @@ int cirrus_bo_push_sysram(struct cirrus_bo *bo)
> ret = ttm_bo_validate(&bo->bo, &bo->placement, false, false);
> if (ret) {
> DRM_ERROR("pushing to VRAM failed\n");
> - return ret;
> + goto out;
> }
> - return 0;
> +
> +out:
> + cirrus_bo_unreserve(bo);
> + return ret;
> }
>
> int cirrus_mmap(struct file *filp, struct vm_area_struct *vma)
--
Gabriel Krisman Bertazi
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
next prev parent reply other threads:[~2017-09-04 10:41 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-18 15:49 [PATCH 00/14] atomic modesetting for cirrus Varad Gautam
2017-08-18 15:49 ` [PATCH 01/14] drm/cirrus: split out bo unpinning from cirrus_bo_push_sysram Varad Gautam
2017-09-04 10:41 ` Gabriel Krisman Bertazi [this message]
2017-09-05 13:04 ` Varad Gautam
2017-08-18 15:49 ` [PATCH 02/14] drm/cirrus: unregister connector on destroy Varad Gautam
2017-08-19 6:10 ` Varad Gautam
2017-08-18 15:49 ` [PATCH 03/14] drm/cirrus: add drm_read to cirrus_driver_fops Varad Gautam
2017-08-18 15:49 ` [PATCH 04/14] drm/cirrus: do not disable outputs on fbdev init for atomic Varad Gautam
2017-08-18 15:49 ` [PATCH 05/14] drm/cirrus: initialize start and size fields Varad Gautam
2017-08-18 15:49 ` [PATCH 06/14] drm/cirrus: Use 32bpp by default Varad Gautam
2017-08-19 8:32 ` Matthew Garrett
2017-08-23 15:40 ` Varad Gautam
2017-08-23 17:38 ` Matthew Garrett
2017-08-18 15:49 ` [PATCH 07/14] drm/cirrus: hardcode vram size Varad Gautam
2017-08-18 15:49 ` [PATCH 08/14] drm/cirrus: implement PRIME export for cirrus Varad Gautam
2017-08-18 15:49 ` [PATCH 09/14] drm/cirrus: use universal plane interfaces for primary plane Varad Gautam
2017-09-04 11:14 ` Gabriel Krisman Bertazi
2017-08-18 15:49 ` [PATCH 10/14] drm/cirrus: use atomic transition helpers for plane and crtc Varad Gautam
2017-08-18 15:49 ` [PATCH 11/14] drm/cirrus: send vblank on crtc atomic_flush Varad Gautam
2017-08-18 15:49 ` [PATCH 12/14] drm/cirrus: use atomic handlers for plane and crtc Varad Gautam
2017-08-18 15:49 ` [PATCH 13/14] drm/cirrus: implement atomic hardware cursor support Varad Gautam
2017-08-18 15:49 ` [PATCH 14/14] drm/cirrus: advertise DRIVER_ATOMIC Varad Gautam
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=87lgluu4oe.fsf@dilma.collabora.co.uk \
--to=krisman@collabora.co.uk \
--cc=dri-devel@lists.freedesktop.org \
--cc=varad.gautam@collabora.com \
--cc=varadgautam@gmail.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