.. | .. |
---|
376 | 376 | return rockchip_drm_logo_fb_alloc(drm_dev, &mode_cmd, private->logo); |
---|
377 | 377 | } |
---|
378 | 378 | |
---|
| 379 | +static void of_parse_post_csc_info(struct device_node *route, struct rockchip_drm_mode_set *set) |
---|
| 380 | +{ |
---|
| 381 | + int val; |
---|
| 382 | + |
---|
| 383 | + if (!of_property_read_u32(route, "post-csc,enable", &val)) |
---|
| 384 | + set->csc.csc_enable = val; |
---|
| 385 | + else |
---|
| 386 | + set->csc.csc_enable = 0; |
---|
| 387 | + |
---|
| 388 | + if (!set->csc.csc_enable) |
---|
| 389 | + return; |
---|
| 390 | + |
---|
| 391 | + if (!of_property_read_u32(route, "post-csc,hue", &val)) |
---|
| 392 | + set->csc.hue = val; |
---|
| 393 | + else |
---|
| 394 | + set->csc.hue = 256; |
---|
| 395 | + |
---|
| 396 | + if (!of_property_read_u32(route, "post-csc,saturation", &val)) |
---|
| 397 | + set->csc.saturation = val; |
---|
| 398 | + else |
---|
| 399 | + set->csc.saturation = 256; |
---|
| 400 | + |
---|
| 401 | + if (!of_property_read_u32(route, "post-csc,contrast", &val)) |
---|
| 402 | + set->csc.contrast = val; |
---|
| 403 | + else |
---|
| 404 | + set->csc.contrast = 256; |
---|
| 405 | + |
---|
| 406 | + if (!of_property_read_u32(route, "post-csc,brightness", &val)) |
---|
| 407 | + set->csc.brightness = val; |
---|
| 408 | + else |
---|
| 409 | + set->csc.brightness = 256; |
---|
| 410 | + |
---|
| 411 | + if (!of_property_read_u32(route, "post-csc,r-gain", &val)) |
---|
| 412 | + set->csc.r_gain = val; |
---|
| 413 | + else |
---|
| 414 | + set->csc.r_gain = 256; |
---|
| 415 | + |
---|
| 416 | + if (!of_property_read_u32(route, "post-csc,g-gain", &val)) |
---|
| 417 | + set->csc.g_gain = val; |
---|
| 418 | + else |
---|
| 419 | + set->csc.g_gain = 256; |
---|
| 420 | + |
---|
| 421 | + if (!of_property_read_u32(route, "post-csc,b-gain", &val)) |
---|
| 422 | + set->csc.b_gain = val; |
---|
| 423 | + else |
---|
| 424 | + set->csc.b_gain = 256; |
---|
| 425 | + |
---|
| 426 | + if (!of_property_read_u32(route, "post-csc,r-offset", &val)) |
---|
| 427 | + set->csc.r_offset = val; |
---|
| 428 | + else |
---|
| 429 | + set->csc.r_offset = 256; |
---|
| 430 | + |
---|
| 431 | + if (!of_property_read_u32(route, "post-csc,g-offset", &val)) |
---|
| 432 | + set->csc.g_offset = val; |
---|
| 433 | + else |
---|
| 434 | + set->csc.g_offset = 256; |
---|
| 435 | + |
---|
| 436 | + if (!of_property_read_u32(route, "post-csc,b-offset", &val)) |
---|
| 437 | + set->csc.b_offset = val; |
---|
| 438 | + else |
---|
| 439 | + set->csc.b_offset = 256; |
---|
| 440 | +} |
---|
| 441 | + |
---|
379 | 442 | static struct rockchip_drm_mode_set * |
---|
380 | 443 | of_parse_display_resource(struct drm_device *drm_dev, struct device_node *route) |
---|
381 | 444 | { |
---|
.. | .. |
---|
469 | 532 | set->hue = val; |
---|
470 | 533 | else |
---|
471 | 534 | set->hue = 50; |
---|
| 535 | + |
---|
| 536 | + of_parse_post_csc_info(route, set); |
---|
472 | 537 | |
---|
473 | 538 | set->force_output = of_property_read_bool(route, "force-output"); |
---|
474 | 539 | |
---|
.. | .. |
---|
746 | 811 | |
---|
747 | 812 | if (priv->crtc_funcs[pipe] && |
---|
748 | 813 | priv->crtc_funcs[pipe]->loader_protect) |
---|
749 | | - priv->crtc_funcs[pipe]->loader_protect(crtc, true); |
---|
| 814 | + priv->crtc_funcs[pipe]->loader_protect(crtc, true, &set->csc); |
---|
750 | 815 | } |
---|
751 | 816 | |
---|
752 | 817 | if (!set->fb) { |
---|
.. | .. |
---|
798 | 863 | |
---|
799 | 864 | error_crtc: |
---|
800 | 865 | if (priv->crtc_funcs[pipe] && priv->crtc_funcs[pipe]->loader_protect) |
---|
801 | | - priv->crtc_funcs[pipe]->loader_protect(crtc, false); |
---|
| 866 | + priv->crtc_funcs[pipe]->loader_protect(crtc, false, NULL); |
---|
802 | 867 | error_conn: |
---|
803 | 868 | if (set->sub_dev->loader_protect) |
---|
804 | 869 | set->sub_dev->loader_protect(conn_state->best_encoder, false); |
---|
.. | .. |
---|
994 | 1059 | unset); |
---|
995 | 1060 | if (priv->crtc_funcs[pipe] && |
---|
996 | 1061 | priv->crtc_funcs[pipe]->loader_protect) |
---|
997 | | - priv->crtc_funcs[pipe]->loader_protect(crtc, true); |
---|
| 1062 | + priv->crtc_funcs[pipe]->loader_protect(crtc, true, |
---|
| 1063 | + &unset->csc); |
---|
998 | 1064 | priv->crtc_funcs[pipe]->crtc_close(crtc); |
---|
999 | 1065 | if (priv->crtc_funcs[pipe] && |
---|
1000 | 1066 | priv->crtc_funcs[pipe]->loader_protect) |
---|
1001 | | - priv->crtc_funcs[pipe]->loader_protect(crtc, false); |
---|
| 1067 | + priv->crtc_funcs[pipe]->loader_protect(crtc, false, NULL); |
---|
1002 | 1068 | } |
---|
1003 | 1069 | } |
---|
1004 | 1070 | |
---|