dce_opp.c 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567
  1. /*
  2. * Copyright 2012-15 Advanced Micro Devices, Inc.
  3. *
  4. * Permission is hereby granted, free of charge, to any person obtaining a
  5. * copy of this software and associated documentation files (the "Software"),
  6. * to deal in the Software without restriction, including without limitation
  7. * the rights to use, copy, modify, merge, publish, distribute, sublicense,
  8. * and/or sell copies of the Software, and to permit persons to whom the
  9. * Software is furnished to do so, subject to the following conditions:
  10. *
  11. * The above copyright notice and this permission notice shall be included in
  12. * all copies or substantial portions of the Software.
  13. *
  14. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  15. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  16. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
  17. * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
  18. * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
  19. * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
  20. * OTHER DEALINGS IN THE SOFTWARE.
  21. *
  22. * Authors: AMD
  23. *
  24. */
  25. #include "dm_services.h"
  26. #include "basics/conversion.h"
  27. #include "dce_opp.h"
  28. #include "reg_helper.h"
  29. #define REG(reg)\
  30. (opp110->regs->reg)
  31. #undef FN
  32. #define FN(reg_name, field_name) \
  33. opp110->opp_shift->field_name, opp110->opp_mask->field_name
  34. #define CTX \
  35. opp110->base.ctx
  36. enum {
  37. MAX_PWL_ENTRY = 128,
  38. MAX_REGIONS_NUMBER = 16
  39. };
  40. enum {
  41. MAX_LUT_ENTRY = 256,
  42. MAX_NUMBER_OF_ENTRIES = 256
  43. };
  44. enum {
  45. OUTPUT_CSC_MATRIX_SIZE = 12
  46. };
  47. /*
  48. *****************************************************************************
  49. * Function: regamma_config_regions_and_segments
  50. *
  51. * build regamma curve by using predefined hw points
  52. * uses interface parameters ,like EDID coeff.
  53. *
  54. * @param : parameters interface parameters
  55. * @return void
  56. *
  57. * @note
  58. *
  59. * @see
  60. *
  61. *****************************************************************************
  62. */
  63. /**
  64. * set_truncation
  65. * 1) set truncation depth: 0 for 18 bpp or 1 for 24 bpp
  66. * 2) enable truncation
  67. * 3) HW remove 12bit FMT support for DCE11 power saving reason.
  68. */
  69. static void set_truncation(
  70. struct dce110_opp *opp110,
  71. const struct bit_depth_reduction_params *params)
  72. {
  73. /*Disable truncation*/
  74. REG_UPDATE_3(FMT_BIT_DEPTH_CONTROL,
  75. FMT_TRUNCATE_EN, 0,
  76. FMT_TRUNCATE_DEPTH, 0,
  77. FMT_TRUNCATE_MODE, 0);
  78. if (params->pixel_encoding == PIXEL_ENCODING_YCBCR422) {
  79. /* 8bpc trunc on YCbCr422*/
  80. if (params->flags.TRUNCATE_DEPTH == 1)
  81. REG_UPDATE_3(FMT_BIT_DEPTH_CONTROL,
  82. FMT_TRUNCATE_EN, 1,
  83. FMT_TRUNCATE_DEPTH, 1,
  84. FMT_TRUNCATE_MODE, 0);
  85. else if (params->flags.TRUNCATE_DEPTH == 2)
  86. /* 10bpc trunc on YCbCr422*/
  87. REG_UPDATE_3(FMT_BIT_DEPTH_CONTROL,
  88. FMT_TRUNCATE_EN, 1,
  89. FMT_TRUNCATE_DEPTH, 2,
  90. FMT_TRUNCATE_MODE, 0);
  91. return;
  92. }
  93. /* on other format-to do */
  94. if (params->flags.TRUNCATE_ENABLED == 0 ||
  95. params->flags.TRUNCATE_DEPTH == 2)
  96. return;
  97. /*Set truncation depth and Enable truncation*/
  98. REG_UPDATE_3(FMT_BIT_DEPTH_CONTROL,
  99. FMT_TRUNCATE_EN, 1,
  100. FMT_TRUNCATE_DEPTH,
  101. params->flags.TRUNCATE_MODE,
  102. FMT_TRUNCATE_MODE,
  103. params->flags.TRUNCATE_DEPTH);
  104. }
  105. /**
  106. * set_spatial_dither
  107. * 1) set spatial dithering mode: pattern of seed
  108. * 2) set spatical dithering depth: 0 for 18bpp or 1 for 24bpp
  109. * 3) set random seed
  110. * 4) set random mode
  111. * lfsr is reset every frame or not reset
  112. * RGB dithering method
  113. * 0: RGB data are all dithered with x^28+x^3+1
  114. * 1: R data is dithered with x^28+x^3+1
  115. * G data is dithered with x^28+X^9+1
  116. * B data is dithered with x^28+x^13+1
  117. * enable high pass filter or not
  118. * 5) enable spatical dithering
  119. */
  120. static void set_spatial_dither(
  121. struct dce110_opp *opp110,
  122. const struct bit_depth_reduction_params *params)
  123. {
  124. /*Disable spatial (random) dithering*/
  125. REG_UPDATE_3(FMT_BIT_DEPTH_CONTROL,
  126. FMT_SPATIAL_DITHER_EN, 0,
  127. FMT_SPATIAL_DITHER_DEPTH, 0,
  128. FMT_SPATIAL_DITHER_MODE, 0);
  129. REG_UPDATE_3(FMT_BIT_DEPTH_CONTROL,
  130. FMT_HIGHPASS_RANDOM_ENABLE, 0,
  131. FMT_FRAME_RANDOM_ENABLE, 0,
  132. FMT_RGB_RANDOM_ENABLE, 0);
  133. REG_UPDATE(FMT_BIT_DEPTH_CONTROL,
  134. FMT_TEMPORAL_DITHER_EN, 0);
  135. /* no 10bpc on DCE11*/
  136. if (params->flags.SPATIAL_DITHER_ENABLED == 0 ||
  137. params->flags.SPATIAL_DITHER_DEPTH == 2)
  138. return;
  139. /* only use FRAME_COUNTER_MAX if frameRandom == 1*/
  140. if (opp110->opp_mask->FMT_SPATIAL_DITHER_FRAME_COUNTER_MAX &&
  141. opp110->opp_mask->FMT_SPATIAL_DITHER_FRAME_COUNTER_BIT_SWAP) {
  142. if (params->flags.FRAME_RANDOM == 1) {
  143. if (params->flags.SPATIAL_DITHER_DEPTH == 0 ||
  144. params->flags.SPATIAL_DITHER_DEPTH == 1) {
  145. REG_UPDATE_2(FMT_CONTROL,
  146. FMT_SPATIAL_DITHER_FRAME_COUNTER_MAX, 15,
  147. FMT_SPATIAL_DITHER_FRAME_COUNTER_BIT_SWAP, 2);
  148. } else if (params->flags.SPATIAL_DITHER_DEPTH == 2) {
  149. REG_UPDATE_2(FMT_CONTROL,
  150. FMT_SPATIAL_DITHER_FRAME_COUNTER_MAX, 3,
  151. FMT_SPATIAL_DITHER_FRAME_COUNTER_BIT_SWAP, 1);
  152. } else
  153. return;
  154. } else {
  155. REG_UPDATE_2(FMT_CONTROL,
  156. FMT_SPATIAL_DITHER_FRAME_COUNTER_MAX, 0,
  157. FMT_SPATIAL_DITHER_FRAME_COUNTER_BIT_SWAP, 0);
  158. }
  159. }
  160. /* Set seed for random values for
  161. * spatial dithering for R,G,B channels
  162. */
  163. REG_UPDATE(FMT_DITHER_RAND_R_SEED,
  164. FMT_RAND_R_SEED, params->r_seed_value);
  165. REG_UPDATE(FMT_DITHER_RAND_G_SEED,
  166. FMT_RAND_G_SEED, params->g_seed_value);
  167. REG_UPDATE(FMT_DITHER_RAND_B_SEED,
  168. FMT_RAND_B_SEED, params->b_seed_value);
  169. /* FMT_OFFSET_R_Cr 31:16 0x0 Setting the zero
  170. * offset for the R/Cr channel, lower 4LSB
  171. * is forced to zeros. Typically set to 0
  172. * RGB and 0x80000 YCbCr.
  173. */
  174. /* FMT_OFFSET_G_Y 31:16 0x0 Setting the zero
  175. * offset for the G/Y channel, lower 4LSB is
  176. * forced to zeros. Typically set to 0 RGB
  177. * and 0x80000 YCbCr.
  178. */
  179. /* FMT_OFFSET_B_Cb 31:16 0x0 Setting the zero
  180. * offset for the B/Cb channel, lower 4LSB is
  181. * forced to zeros. Typically set to 0 RGB and
  182. * 0x80000 YCbCr.
  183. */
  184. /* Disable High pass filter
  185. * Reset only at startup
  186. * Set RGB data dithered with x^28+x^3+1
  187. */
  188. REG_UPDATE_3(FMT_BIT_DEPTH_CONTROL,
  189. FMT_HIGHPASS_RANDOM_ENABLE, params->flags.HIGHPASS_RANDOM,
  190. FMT_FRAME_RANDOM_ENABLE, params->flags.FRAME_RANDOM,
  191. FMT_RGB_RANDOM_ENABLE, params->flags.RGB_RANDOM);
  192. /* Set spatial dithering bit depth
  193. * Set spatial dithering mode
  194. * (default is Seed patterrn AAAA...)
  195. * Enable spatial dithering
  196. */
  197. REG_UPDATE_3(FMT_BIT_DEPTH_CONTROL,
  198. FMT_SPATIAL_DITHER_DEPTH, params->flags.SPATIAL_DITHER_DEPTH,
  199. FMT_SPATIAL_DITHER_MODE, params->flags.SPATIAL_DITHER_MODE,
  200. FMT_SPATIAL_DITHER_EN, 1);
  201. }
  202. /**
  203. * SetTemporalDither (Frame Modulation)
  204. * 1) set temporal dither depth
  205. * 2) select pattern: from hard-coded pattern or programmable pattern
  206. * 3) select optimized strips for BGR or RGB LCD sub-pixel
  207. * 4) set s matrix
  208. * 5) set t matrix
  209. * 6) set grey level for 0.25, 0.5, 0.75
  210. * 7) enable temporal dithering
  211. */
  212. static void set_temporal_dither(
  213. struct dce110_opp *opp110,
  214. const struct bit_depth_reduction_params *params)
  215. {
  216. /*Disable temporal (frame modulation) dithering first*/
  217. REG_UPDATE_3(FMT_BIT_DEPTH_CONTROL,
  218. FMT_TEMPORAL_DITHER_EN, 0,
  219. FMT_TEMPORAL_DITHER_RESET, 0,
  220. FMT_TEMPORAL_DITHER_OFFSET, 0);
  221. REG_UPDATE_2(FMT_BIT_DEPTH_CONTROL,
  222. FMT_TEMPORAL_DITHER_DEPTH, 0,
  223. FMT_TEMPORAL_LEVEL, 0);
  224. REG_UPDATE_3(FMT_BIT_DEPTH_CONTROL,
  225. FMT_25FRC_SEL, 0,
  226. FMT_50FRC_SEL, 0,
  227. FMT_75FRC_SEL, 0);
  228. /* no 10bpc dither on DCE11*/
  229. if (params->flags.FRAME_MODULATION_ENABLED == 0 ||
  230. params->flags.FRAME_MODULATION_DEPTH == 2)
  231. return;
  232. /* Set temporal dithering depth*/
  233. REG_UPDATE_3(FMT_BIT_DEPTH_CONTROL,
  234. FMT_TEMPORAL_DITHER_DEPTH, params->flags.FRAME_MODULATION_DEPTH,
  235. FMT_TEMPORAL_DITHER_RESET, 0,
  236. FMT_TEMPORAL_DITHER_OFFSET, 0);
  237. /*Select legacy pattern based on FRC and Temporal level*/
  238. if (REG(FMT_TEMPORAL_DITHER_PATTERN_CONTROL)) {
  239. REG_WRITE(FMT_TEMPORAL_DITHER_PATTERN_CONTROL, 0);
  240. /*Set s matrix*/
  241. REG_WRITE(FMT_TEMPORAL_DITHER_PROGRAMMABLE_PATTERN_S_MATRIX, 0);
  242. /*Set t matrix*/
  243. REG_WRITE(FMT_TEMPORAL_DITHER_PROGRAMMABLE_PATTERN_T_MATRIX, 0);
  244. }
  245. /*Select patterns for 0.25, 0.5 and 0.75 grey level*/
  246. REG_UPDATE(FMT_BIT_DEPTH_CONTROL,
  247. FMT_TEMPORAL_LEVEL, params->flags.TEMPORAL_LEVEL);
  248. REG_UPDATE_3(FMT_BIT_DEPTH_CONTROL,
  249. FMT_25FRC_SEL, params->flags.FRC25,
  250. FMT_50FRC_SEL, params->flags.FRC50,
  251. FMT_75FRC_SEL, params->flags.FRC75);
  252. /*Enable bit reduction by temporal (frame modulation) dithering*/
  253. REG_UPDATE(FMT_BIT_DEPTH_CONTROL,
  254. FMT_TEMPORAL_DITHER_EN, 1);
  255. }
  256. /**
  257. * Set Clamping
  258. * 1) Set clamping format based on bpc - 0 for 6bpc (No clamping)
  259. * 1 for 8 bpc
  260. * 2 for 10 bpc
  261. * 3 for 12 bpc
  262. * 7 for programable
  263. * 2) Enable clamp if Limited range requested
  264. */
  265. void dce110_opp_set_clamping(
  266. struct dce110_opp *opp110,
  267. const struct clamping_and_pixel_encoding_params *params)
  268. {
  269. REG_SET_2(FMT_CLAMP_CNTL, 0,
  270. FMT_CLAMP_DATA_EN, 0,
  271. FMT_CLAMP_COLOR_FORMAT, 0);
  272. switch (params->clamping_level) {
  273. case CLAMPING_FULL_RANGE:
  274. break;
  275. case CLAMPING_LIMITED_RANGE_8BPC:
  276. REG_SET_2(FMT_CLAMP_CNTL, 0,
  277. FMT_CLAMP_DATA_EN, 1,
  278. FMT_CLAMP_COLOR_FORMAT, 1);
  279. break;
  280. case CLAMPING_LIMITED_RANGE_10BPC:
  281. REG_SET_2(FMT_CLAMP_CNTL, 0,
  282. FMT_CLAMP_DATA_EN, 1,
  283. FMT_CLAMP_COLOR_FORMAT, 2);
  284. break;
  285. case CLAMPING_LIMITED_RANGE_12BPC:
  286. REG_SET_2(FMT_CLAMP_CNTL, 0,
  287. FMT_CLAMP_DATA_EN, 1,
  288. FMT_CLAMP_COLOR_FORMAT, 3);
  289. break;
  290. case CLAMPING_LIMITED_RANGE_PROGRAMMABLE:
  291. /*Set clamp control*/
  292. REG_SET_2(FMT_CLAMP_CNTL, 0,
  293. FMT_CLAMP_DATA_EN, 1,
  294. FMT_CLAMP_COLOR_FORMAT, 7);
  295. /*set the defaults*/
  296. REG_SET_2(FMT_CLAMP_COMPONENT_R, 0,
  297. FMT_CLAMP_LOWER_R, 0x10,
  298. FMT_CLAMP_UPPER_R, 0xFEF);
  299. REG_SET_2(FMT_CLAMP_COMPONENT_G, 0,
  300. FMT_CLAMP_LOWER_G, 0x10,
  301. FMT_CLAMP_UPPER_G, 0xFEF);
  302. REG_SET_2(FMT_CLAMP_COMPONENT_B, 0,
  303. FMT_CLAMP_LOWER_B, 0x10,
  304. FMT_CLAMP_UPPER_B, 0xFEF);
  305. break;
  306. default:
  307. break;
  308. }
  309. }
  310. /**
  311. * set_pixel_encoding
  312. *
  313. * Set Pixel Encoding
  314. * 0: RGB 4:4:4 or YCbCr 4:4:4 or YOnly
  315. * 1: YCbCr 4:2:2
  316. */
  317. static void set_pixel_encoding(
  318. struct dce110_opp *opp110,
  319. const struct clamping_and_pixel_encoding_params *params)
  320. {
  321. if (opp110->opp_mask->FMT_CBCR_BIT_REDUCTION_BYPASS)
  322. REG_UPDATE_3(FMT_CONTROL,
  323. FMT_PIXEL_ENCODING, 0,
  324. FMT_SUBSAMPLING_MODE, 0,
  325. FMT_CBCR_BIT_REDUCTION_BYPASS, 0);
  326. else
  327. REG_UPDATE_2(FMT_CONTROL,
  328. FMT_PIXEL_ENCODING, 0,
  329. FMT_SUBSAMPLING_MODE, 0);
  330. if (params->pixel_encoding == PIXEL_ENCODING_YCBCR422) {
  331. REG_UPDATE_2(FMT_CONTROL,
  332. FMT_PIXEL_ENCODING, 1,
  333. FMT_SUBSAMPLING_ORDER, 0);
  334. }
  335. if (params->pixel_encoding == PIXEL_ENCODING_YCBCR420) {
  336. REG_UPDATE_3(FMT_CONTROL,
  337. FMT_PIXEL_ENCODING, 2,
  338. FMT_SUBSAMPLING_MODE, 2,
  339. FMT_CBCR_BIT_REDUCTION_BYPASS, 1);
  340. }
  341. }
  342. void dce110_opp_program_bit_depth_reduction(
  343. struct output_pixel_processor *opp,
  344. const struct bit_depth_reduction_params *params)
  345. {
  346. struct dce110_opp *opp110 = TO_DCE110_OPP(opp);
  347. set_truncation(opp110, params);
  348. set_spatial_dither(opp110, params);
  349. set_temporal_dither(opp110, params);
  350. }
  351. void dce110_opp_program_clamping_and_pixel_encoding(
  352. struct output_pixel_processor *opp,
  353. const struct clamping_and_pixel_encoding_params *params)
  354. {
  355. struct dce110_opp *opp110 = TO_DCE110_OPP(opp);
  356. dce110_opp_set_clamping(opp110, params);
  357. set_pixel_encoding(opp110, params);
  358. }
  359. static void program_formatter_420_memory(struct output_pixel_processor *opp)
  360. {
  361. struct dce110_opp *opp110 = TO_DCE110_OPP(opp);
  362. uint32_t fmt_mem_cntl_value;
  363. /* Program source select*/
  364. /* Use HW default source select for FMT_MEMORYx_CONTROL */
  365. /* Use that value for FMT_SRC_SELECT as well*/
  366. REG_GET(CONTROL,
  367. FMT420_MEM0_SOURCE_SEL, &fmt_mem_cntl_value);
  368. REG_UPDATE(FMT_CONTROL,
  369. FMT_SRC_SELECT, fmt_mem_cntl_value);
  370. /* Turn on the memory */
  371. REG_UPDATE(CONTROL,
  372. FMT420_MEM0_PWR_FORCE, 0);
  373. }
  374. void dce110_opp_set_dyn_expansion(
  375. struct output_pixel_processor *opp,
  376. enum dc_color_space color_sp,
  377. enum dc_color_depth color_dpth,
  378. enum signal_type signal)
  379. {
  380. struct dce110_opp *opp110 = TO_DCE110_OPP(opp);
  381. REG_UPDATE_2(FMT_DYNAMIC_EXP_CNTL,
  382. FMT_DYNAMIC_EXP_EN, 0,
  383. FMT_DYNAMIC_EXP_MODE, 0);
  384. /*00 - 10-bit -> 12-bit dynamic expansion*/
  385. /*01 - 8-bit -> 12-bit dynamic expansion*/
  386. if (signal == SIGNAL_TYPE_HDMI_TYPE_A ||
  387. signal == SIGNAL_TYPE_DISPLAY_PORT ||
  388. signal == SIGNAL_TYPE_DISPLAY_PORT_MST) {
  389. switch (color_dpth) {
  390. case COLOR_DEPTH_888:
  391. REG_UPDATE_2(FMT_DYNAMIC_EXP_CNTL,
  392. FMT_DYNAMIC_EXP_EN, 1,
  393. FMT_DYNAMIC_EXP_MODE, 1);
  394. break;
  395. case COLOR_DEPTH_101010:
  396. REG_UPDATE_2(FMT_DYNAMIC_EXP_CNTL,
  397. FMT_DYNAMIC_EXP_EN, 1,
  398. FMT_DYNAMIC_EXP_MODE, 0);
  399. break;
  400. case COLOR_DEPTH_121212:
  401. REG_UPDATE_2(
  402. FMT_DYNAMIC_EXP_CNTL,
  403. FMT_DYNAMIC_EXP_EN, 1,/*otherwise last two bits are zero*/
  404. FMT_DYNAMIC_EXP_MODE, 0);
  405. break;
  406. default:
  407. break;
  408. }
  409. }
  410. }
  411. static void program_formatter_reset_dig_resync_fifo(struct output_pixel_processor *opp)
  412. {
  413. struct dce110_opp *opp110 = TO_DCE110_OPP(opp);
  414. /* clear previous phase lock status*/
  415. REG_UPDATE(FMT_CONTROL,
  416. FMT_420_PIXEL_PHASE_LOCKED_CLEAR, 1);
  417. /* poll until FMT_420_PIXEL_PHASE_LOCKED become 1*/
  418. REG_WAIT(FMT_CONTROL, FMT_420_PIXEL_PHASE_LOCKED, 1, 10, 10);
  419. }
  420. void dce110_opp_program_fmt(
  421. struct output_pixel_processor *opp,
  422. struct bit_depth_reduction_params *fmt_bit_depth,
  423. struct clamping_and_pixel_encoding_params *clamping)
  424. {
  425. /* dithering is affected by <CrtcSourceSelect>, hence should be
  426. * programmed afterwards */
  427. if (clamping->pixel_encoding == PIXEL_ENCODING_YCBCR420)
  428. program_formatter_420_memory(opp);
  429. dce110_opp_program_bit_depth_reduction(
  430. opp,
  431. fmt_bit_depth);
  432. dce110_opp_program_clamping_and_pixel_encoding(
  433. opp,
  434. clamping);
  435. if (clamping->pixel_encoding == PIXEL_ENCODING_YCBCR420)
  436. program_formatter_reset_dig_resync_fifo(opp);
  437. return;
  438. }
  439. /*****************************************/
  440. /* Constructor, Destructor */
  441. /*****************************************/
  442. static const struct opp_funcs funcs = {
  443. .opp_set_dyn_expansion = dce110_opp_set_dyn_expansion,
  444. .opp_destroy = dce110_opp_destroy,
  445. .opp_program_fmt = dce110_opp_program_fmt,
  446. .opp_program_bit_depth_reduction = dce110_opp_program_bit_depth_reduction
  447. };
  448. void dce110_opp_construct(struct dce110_opp *opp110,
  449. struct dc_context *ctx,
  450. uint32_t inst,
  451. const struct dce_opp_registers *regs,
  452. const struct dce_opp_shift *opp_shift,
  453. const struct dce_opp_mask *opp_mask)
  454. {
  455. opp110->base.funcs = &funcs;
  456. opp110->base.ctx = ctx;
  457. opp110->base.inst = inst;
  458. opp110->regs = regs;
  459. opp110->opp_shift = opp_shift;
  460. opp110->opp_mask = opp_mask;
  461. }
  462. void dce110_opp_destroy(struct output_pixel_processor **opp)
  463. {
  464. if (*opp)
  465. kfree(FROM_DCE11_OPP(*opp));
  466. *opp = NULL;
  467. }