aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/nouveau/nouveau_display.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/drm/nouveau/nouveau_display.c')
-rw-r--r--drivers/gpu/drm/nouveau/nouveau_display.c37
1 files changed, 24 insertions, 13 deletions
diff --git a/drivers/gpu/drm/nouveau/nouveau_display.c b/drivers/gpu/drm/nouveau/nouveau_display.c
index 795a9e3c990a..c01ae781e2a7 100644
--- a/drivers/gpu/drm/nouveau/nouveau_display.c
+++ b/drivers/gpu/drm/nouveau/nouveau_display.c
@@ -155,20 +155,20 @@ static const struct drm_mode_config_funcs nouveau_mode_config_funcs = {
155}; 155};
156 156
157 157
158struct drm_prop_enum_list { 158struct nouveau_drm_prop_enum_list {
159 u8 gen_mask; 159 u8 gen_mask;
160 int type; 160 int type;
161 char *name; 161 char *name;
162}; 162};
163 163
164static struct drm_prop_enum_list underscan[] = { 164static struct nouveau_drm_prop_enum_list underscan[] = {
165 { 6, UNDERSCAN_AUTO, "auto" }, 165 { 6, UNDERSCAN_AUTO, "auto" },
166 { 6, UNDERSCAN_OFF, "off" }, 166 { 6, UNDERSCAN_OFF, "off" },
167 { 6, UNDERSCAN_ON, "on" }, 167 { 6, UNDERSCAN_ON, "on" },
168 {} 168 {}
169}; 169};
170 170
171static struct drm_prop_enum_list dither_mode[] = { 171static struct nouveau_drm_prop_enum_list dither_mode[] = {
172 { 7, DITHERING_MODE_AUTO, "auto" }, 172 { 7, DITHERING_MODE_AUTO, "auto" },
173 { 7, DITHERING_MODE_OFF, "off" }, 173 { 7, DITHERING_MODE_OFF, "off" },
174 { 1, DITHERING_MODE_ON, "on" }, 174 { 1, DITHERING_MODE_ON, "on" },
@@ -178,7 +178,7 @@ static struct drm_prop_enum_list dither_mode[] = {
178 {} 178 {}
179}; 179};
180 180
181static struct drm_prop_enum_list dither_depth[] = { 181static struct nouveau_drm_prop_enum_list dither_depth[] = {
182 { 6, DITHERING_DEPTH_AUTO, "auto" }, 182 { 6, DITHERING_DEPTH_AUTO, "auto" },
183 { 6, DITHERING_DEPTH_6BPC, "6 bpc" }, 183 { 6, DITHERING_DEPTH_6BPC, "6 bpc" },
184 { 6, DITHERING_DEPTH_8BPC, "8 bpc" }, 184 { 6, DITHERING_DEPTH_8BPC, "8 bpc" },
@@ -186,7 +186,7 @@ static struct drm_prop_enum_list dither_depth[] = {
186}; 186};
187 187
188#define PROP_ENUM(p,gen,n,list) do { \ 188#define PROP_ENUM(p,gen,n,list) do { \
189 struct drm_prop_enum_list *l = (list); \ 189 struct nouveau_drm_prop_enum_list *l = (list); \
190 int c = 0; \ 190 int c = 0; \
191 while (l->gen_mask) { \ 191 while (l->gen_mask) { \
192 if (l->gen_mask & (1 << (gen))) \ 192 if (l->gen_mask & (1 << (gen))) \
@@ -281,16 +281,24 @@ nouveau_display_create(struct drm_device *dev)
281 PROP_ENUM(disp->underscan_property, gen, "underscan", underscan); 281 PROP_ENUM(disp->underscan_property, gen, "underscan", underscan);
282 282
283 disp->underscan_hborder_property = 283 disp->underscan_hborder_property =
284 drm_property_create(dev, DRM_MODE_PROP_RANGE, 284 drm_property_create_range(dev, 0, "underscan hborder", 0, 128);
285 "underscan hborder", 2);
286 disp->underscan_hborder_property->values[0] = 0;
287 disp->underscan_hborder_property->values[1] = 128;
288 285
289 disp->underscan_vborder_property = 286 disp->underscan_vborder_property =
290 drm_property_create(dev, DRM_MODE_PROP_RANGE, 287 drm_property_create_range(dev, 0, "underscan vborder", 0, 128);
291 "underscan vborder", 2); 288
292 disp->underscan_vborder_property->values[0] = 0; 289 if (gen == 1) {
293 disp->underscan_vborder_property->values[1] = 128; 290 disp->vibrant_hue_property =
291 drm_property_create(dev, DRM_MODE_PROP_RANGE,
292 "vibrant hue", 2);
293 disp->vibrant_hue_property->values[0] = 0;
294 disp->vibrant_hue_property->values[1] = 180; /* -90..+90 */
295
296 disp->color_vibrance_property =
297 drm_property_create(dev, DRM_MODE_PROP_RANGE,
298 "color vibrance", 2);
299 disp->color_vibrance_property->values[0] = 0;
300 disp->color_vibrance_property->values[1] = 200; /* -100..+100 */
301 }
294 302
295 dev->mode_config.funcs = (void *)&nouveau_mode_config_funcs; 303 dev->mode_config.funcs = (void *)&nouveau_mode_config_funcs;
296 dev->mode_config.fb_base = pci_resource_start(dev->pdev, 1); 304 dev->mode_config.fb_base = pci_resource_start(dev->pdev, 1);
@@ -309,6 +317,9 @@ nouveau_display_create(struct drm_device *dev)
309 dev->mode_config.max_height = 8192; 317 dev->mode_config.max_height = 8192;
310 } 318 }
311 319
320 dev->mode_config.preferred_depth = 24;
321 dev->mode_config.prefer_shadow = 1;
322
312 drm_kms_helper_poll_init(dev); 323 drm_kms_helper_poll_init(dev);
313 drm_kms_helper_poll_disable(dev); 324 drm_kms_helper_poll_disable(dev);
314 325