Lines Matching refs:attrs
1209 static int check_gamma(struct drm_intel_overlay_attrs *attrs)
1211 if (!check_gamma_bounds(0, attrs->gamma0) ||
1212 !check_gamma_bounds(attrs->gamma0, attrs->gamma1) ||
1213 !check_gamma_bounds(attrs->gamma1, attrs->gamma2) ||
1214 !check_gamma_bounds(attrs->gamma2, attrs->gamma3) ||
1215 !check_gamma_bounds(attrs->gamma3, attrs->gamma4) ||
1216 !check_gamma_bounds(attrs->gamma4, attrs->gamma5) ||
1217 !check_gamma_bounds(attrs->gamma5, 0x00ffffff))
1220 if (!check_gamma5_errata(attrs->gamma5))
1228 struct drm_intel_overlay_attrs *attrs = data;
1245 if (!(attrs->flags & I915_OVERLAY_UPDATE_ATTRS)) {
1246 attrs->color_key = overlay->color_key;
1247 attrs->brightness = overlay->brightness;
1248 attrs->contrast = overlay->contrast;
1249 attrs->saturation = overlay->saturation;
1252 attrs->gamma0 = I915_READ(OGAMC0);
1253 attrs->gamma1 = I915_READ(OGAMC1);
1254 attrs->gamma2 = I915_READ(OGAMC2);
1255 attrs->gamma3 = I915_READ(OGAMC3);
1256 attrs->gamma4 = I915_READ(OGAMC4);
1257 attrs->gamma5 = I915_READ(OGAMC5);
1260 if (attrs->brightness < -128 || attrs->brightness > 127)
1262 if (attrs->contrast > 255)
1264 if (attrs->saturation > 1023)
1267 overlay->color_key = attrs->color_key;
1268 overlay->brightness = attrs->brightness;
1269 overlay->contrast = attrs->contrast;
1270 overlay->saturation = attrs->saturation;
1282 if (attrs->flags & I915_OVERLAY_UPDATE_GAMMA) {
1291 ret = check_gamma(attrs);
1295 I915_WRITE(OGAMC0, attrs->gamma0);
1296 I915_WRITE(OGAMC1, attrs->gamma1);
1297 I915_WRITE(OGAMC2, attrs->gamma2);
1298 I915_WRITE(OGAMC3, attrs->gamma3);
1299 I915_WRITE(OGAMC4, attrs->gamma4);
1300 I915_WRITE(OGAMC5, attrs->gamma5);