From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Jindal, Sonika" Subject: Re: [v2 10/11] drm/i915: Add 180 degree primary plane rotation support Date: Sun, 06 Jul 2014 13:38:05 +0530 Message-ID: <53B903E5.4020603@intel.com> References: <1404467043-5072-1-git-send-email-sonika.jindal@intel.com> <1404467043-5072-11-git-send-email-sonika.jindal@intel.com> <20140704145836.GG7634@strange.ger.corp.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20140704145836.GG7634@strange.ger.corp.intel.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" To: Damien Lespiau Cc: intel-gfx@lists.freedesktop.org, Sagar Kamble , dri-devel@lists.freedesktop.org List-Id: intel-gfx@lists.freedesktop.org On 7/4/2014 8:28 PM, Damien Lespiau wrote: > On Fri, Jul 04, 2014 at 03:14:02PM +0530, sonika.jindal@intel.com wrote: >> +static int intel_primary_plane_set_property(struct drm_plane *plane, >> + struct drm_property *prop, >> + uint64_t val) >> +{ >> + struct drm_device *dev = plane->dev; >> + struct drm_i915_private *dev_priv = dev->dev_private; >> + struct intel_plane *intel_plane = to_intel_plane(plane); >> + struct intel_crtc *intel_crtc = to_intel_crtc(plane->crtc); >> + struct drm_crtc *crtc = &intel_crtc->base; >> + uint64_t old_val; >> + >> + if (prop == plane->rotation_property) { >> + /* exactly one rotation angle please */ >> + if (hweight32(val & 0xf) != 1) >> + return -EINVAL; >> + >> + old_val = intel_plane->rotation; >> + intel_plane->rotation = val; >> + >> + if (intel_crtc->active && intel_crtc->primary_enabled) { >> + intel_crtc_wait_for_pending_flips(crtc); >> + >> + /* FBC does not work on some platforms for rotated planes */ >> + if (INTEL_INFO(dev)->gen <= 4 && !IS_G4X(dev)) { >> + if (dev_priv->fbc.plane == intel_crtc->plane && >> + intel_plane->rotation != BIT(DRM_ROTATE_0)) >> + intel_disable_fbc(dev); >> + /* If rotation was set earlier and new rotation is 0, we might >> + * have disabled fbc earlier. So update it now */ >> + else if (intel_plane->rotation == BIT(DRM_ROTATE_0) && >> + old_val != BIT(DRM_ROTATE_0)) >> + intel_update_fbc(dev); > > I see a intel_update_fbc() called with the struct_mutext lock elsewhere, > don't we need it here as well? > > mutex_lock(&dev->struct_mutex); > intel_update_fbc(dev); > mutex_unlock(&dev->struct_mutex); > Sure, I'l add that and post the patch.