void (*restore)(struct drm_connector *connector);
enum drm_connector_status (*detect)(struct drm_connector *connector);
void (*fill_modes)(struct drm_connector *connector, uint32_t max_width, uint32_t max_height);
- bool (*set_property)(struct drm_connector *connector, struct drm_property *property,
+ int (*set_property)(struct drm_connector *connector, struct drm_property *property,
uint64_t val);
void (*destroy)(struct drm_connector *connector);
};
return intel_ddc_get_modes(intel_output);
}
-static bool intel_crt_set_property(struct drm_connector *connector,
+static int intel_crt_set_property(struct drm_connector *connector,
struct drm_property *property,
uint64_t value)
{
if (property == dev->mode_config.dpms_property && connector->encoder)
intel_crt_dpms(connector->encoder, (uint32_t)(value & 0xf));
- return true;
+ return 0;
}
/*
}
}
-static bool nv50_kms_connector_set_property(struct drm_connector *drm_connector,
+static int nv50_kms_connector_set_property(struct drm_connector *drm_connector,
struct drm_property *property,
uint64_t value)
{
struct drm_device *dev = drm_connector->dev;
struct nv50_connector *connector = to_nv50_connector(drm_connector);
+ int rval = 0;
/* DPMS */
if (property == dev->mode_config.dpms_property && drm_connector->encoder) {
struct nv50_output *output = to_nv50_output(drm_connector->encoder);
- if (!output->set_power_mode(output, (int) value))
- return true;
- else
- return false;
+ rval = output->set_power_mode(output, (int) value);
+
+ return rval;
}
/* Scaling mode */
struct nv50_crtc *crtc = NULL;
struct nv50_display *display = nv50_get_display(dev);
int internal_value = 0;
- int rval = 0;
switch (value) {
case DRM_MODE_SCALE_NON_GPU:
crtc = to_nv50_crtc(drm_connector->encoder->crtc);
if (!crtc)
- return true;
+ return 0;
crtc->scaling_mode = connector->scaling_mode;
rval = crtc->set_scale(crtc);
if (rval)
- return false;
+ return rval;
/* process command buffer */
display->update(display);
- return true;
+ return 0;
}
/* Dithering */
if (property == dev->mode_config.dithering_mode_property) {
struct nv50_crtc *crtc = NULL;
struct nv50_display *display = nv50_get_display(dev);
- int rval = 0;
if (value == DRM_MODE_DITHERING_ON)
connector->use_dithering = true;
crtc = to_nv50_crtc(drm_connector->encoder->crtc);
if (!crtc)
- return true;
+ return 0;
/* update hw state */
crtc->use_dithering = connector->use_dithering;
rval = crtc->set_dither(crtc);
if (rval)
- return false;
+ return rval;
/* process command buffer */
display->update(display);
- return true;
+ return 0;
}
- return false;
+ return -EINVAL;
}
static const struct drm_connector_funcs nv50_kms_connector_funcs = {