diff options
author | Russell King <rmk@armlinux.org.uk> | 2017-02-24 23:30:38 +0000 |
---|---|---|
committer | Russell King <rmk@armlinux.org.uk> | 2017-02-25 17:16:13 +0000 |
commit | 3414df521507838645d720e6fb67036381ae5aae (patch) | |
tree | 9c694bf50e8859d5f0ebd2a9d30d5e3a050fa686 | |
parent | d4de6021f46630aa038bd5550e41349dc8312dcc (diff) |
src: Xv: no need to store the full property
There is no need to store a pointer to the full property; we only need
the property id to update the values in the kernel. Store the ID and
free the property structure.
Signed-off-by: Russell King <rmk@armlinux.org.uk>
-rw-r--r-- | src/armada_drm_xv.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/src/armada_drm_xv.c b/src/armada_drm_xv.c index 861eda4..6a51e74 100644 --- a/src/armada_drm_xv.c +++ b/src/armada_drm_xv.c @@ -52,7 +52,7 @@ static const char *armada_drm_property_names[NR_DRM_PROPS] = { }; struct drm_xv_prop { - drmModePropertyPtr prop; + uint32_t prop_id; uint64_t value; }; @@ -120,11 +120,11 @@ static int armada_drm_prop_set(ScrnInfoPtr pScrn, uint32_t prop_id; unsigned i; - if (!prop->prop) + if (prop->prop_id == 0) return Success; /* Actually BadMatch... */ prop->value = value; - prop_id = prop->prop->prop_id; + prop_id = prop->prop_id; for (i = 0; i < ARRAY_SIZE(drmxv->planes); i++) { if (!drmxv->planes[i]) @@ -1147,19 +1147,17 @@ Bool armada_drm_XvInit(ScrnInfoPtr pScrn) for (k = 0; k < NR_DRM_PROPS; k++) { const char *name = armada_drm_property_names[k]; - if (drmxv->props[k].prop) + if (drmxv->props[k].prop_id) continue; if (strcmp(prop->name, name) == 0) { - drmxv->props[k].prop = prop; + drmxv->props[k].prop_id = prop->prop_id; drmxv->props[k].value = props->prop_values[j]; - prop = NULL; break; } } - if (prop) - drmModeFreeProperty(prop); + drmModeFreeProperty(prop); } drmModeFreeObjectProperties(props); } |