[Intel-gfx] [PATCH] drm/atomic: allow setting a blob to NULL using id = 0
Daniel Stone
daniel at fooishbar.org
Fri Dec 18 08:55:46 PST 2015
On 18 December 2015 at 15:17, Lionel Landwerlin
<lionel.g.landwerlin at intel.com> wrote:
> Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin at intel.com>
> ---
> drivers/gpu/drm/drm_atomic.c | 12 +++++++-----
> 1 file changed, 7 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/gpu/drm/drm_atomic.c b/drivers/gpu/drm/drm_atomic.c
> index 65f007a..b8c90a4 100644
> --- a/drivers/gpu/drm/drm_atomic.c
> +++ b/drivers/gpu/drm/drm_atomic.c
> @@ -403,12 +403,14 @@ EXPORT_SYMBOL(drm_atomic_set_mode_prop_for_crtc);
> static int drm_atomic_crtc_set_blob(struct drm_device *dev,
> struct drm_property_blob **state_blob, uint32_t blob_id)
> {
> - struct drm_property_blob *blob;
> + struct drm_property_blob *blob = NULL;
>
> - blob = drm_property_lookup_blob(dev, blob_id);
> - if (!blob) {
> - DRM_DEBUG_KMS("Invalid Blob ID\n");
> - return -EINVAL;
> + if (blob_id != 0) {
> + blob = drm_property_lookup_blob(dev, blob_id);
> + if (!blob) {
> + DRM_DEBUG_KMS("Invalid Blob ID\n");
> + return -EINVAL;
> + }
> }
Heh, almost exactly what I suggested! :)
Given that this was only introduced by 1/6 of the CM patchset though,
just integrate this into the next round of CM rather than posting it
separately I think.
Cheers,
Daniel
More information about the Intel-gfx
mailing list