dce_opp.c 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566
  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. return;
  96. /*Set truncation depth and Enable truncation*/
  97. REG_UPDATE_3(FMT_BIT_DEPTH_CONTROL,
  98. FMT_TRUNCATE_EN, 1,
  99. FMT_TRUNCATE_DEPTH,
  100. params->flags.TRUNCATE_DEPTH,
  101. FMT_TRUNCATE_MODE,
  102. params->flags.TRUNCATE_MODE);
  103. }
  104. /**
  105. * set_spatial_dither
  106. * 1) set spatial dithering mode: pattern of seed
  107. * 2) set spatial dithering depth: 0 for 18bpp or 1 for 24bpp
  108. * 3) set random seed
  109. * 4) set random mode
  110. * lfsr is reset every frame or not reset
  111. * RGB dithering method
  112. * 0: RGB data are all dithered with x^28+x^3+1
  113. * 1: R data is dithered with x^28+x^3+1
  114. * G data is dithered with x^28+X^9+1
  115. * B data is dithered with x^28+x^13+1
  116. * enable high pass filter or not
  117. * 5) enable spatical dithering
  118. */
  119. static void set_spatial_dither(
  120. struct dce110_opp *opp110,
  121. const struct bit_depth_reduction_params *params)
  122. {
  123. /*Disable spatial (random) dithering*/
  124. REG_UPDATE_3(FMT_BIT_DEPTH_CONTROL,
  125. FMT_SPATIAL_DITHER_EN, 0,
  126. FMT_SPATIAL_DITHER_DEPTH, 0,
  127. FMT_SPATIAL_DITHER_MODE, 0);
  128. REG_UPDATE_3(FMT_BIT_DEPTH_CONTROL,
  129. FMT_HIGHPASS_RANDOM_ENABLE, 0,
  130. FMT_FRAME_RANDOM_ENABLE, 0,
  131. FMT_RGB_RANDOM_ENABLE, 0);
  132. REG_UPDATE(FMT_BIT_DEPTH_CONTROL,
  133. FMT_TEMPORAL_DITHER_EN, 0);
  134. /* no 10bpc on DCE11*/
  135. if (params->flags.SPATIAL_DITHER_ENABLED == 0 ||
  136. params->flags.SPATIAL_DITHER_DEPTH == 2)
  137. return;
  138. /* only use FRAME_COUNTER_MAX if frameRandom == 1*/
  139. if (opp110->opp_mask->FMT_SPATIAL_DITHER_FRAME_COUNTER_MAX &&
  140. opp110->opp_mask->FMT_SPATIAL_DITHER_FRAME_COUNTER_BIT_SWAP) {
  141. if (params->flags.FRAME_RANDOM == 1) {
  142. if (params->flags.SPATIAL_DITHER_DEPTH == 0 ||
  143. params->flags.SPATIAL_DITHER_DEPTH == 1) {
  144. REG_UPDATE_2(FMT_CONTROL,
  145. FMT_SPATIAL_DITHER_FRAME_COUNTER_MAX, 15,
  146. FMT_SPATIAL_DITHER_FRAME_COUNTER_BIT_SWAP, 2);
  147. } else if (params->flags.SPATIAL_DITHER_DEPTH == 2) {
  148. REG_UPDATE_2(FMT_CONTROL,
  149. FMT_SPATIAL_DITHER_FRAME_COUNTER_MAX, 3,
  150. FMT_SPATIAL_DITHER_FRAME_COUNTER_BIT_SWAP, 1);
  151. } else
  152. return;
  153. } else {
  154. REG_UPDATE_2(FMT_CONTROL,
  155. FMT_SPATIAL_DITHER_FRAME_COUNTER_MAX, 0,
  156. FMT_SPATIAL_DITHER_FRAME_COUNTER_BIT_SWAP, 0);
  157. }
  158. }
  159. /* Set seed for random values for
  160. * spatial dithering for R,G,B channels
  161. */
  162. REG_UPDATE(FMT_DITHER_RAND_R_SEED,
  163. FMT_RAND_R_SEED, params->r_seed_value);
  164. REG_UPDATE(FMT_DITHER_RAND_G_SEED,
  165. FMT_RAND_G_SEED, params->g_seed_value);
  166. REG_UPDATE(FMT_DITHER_RAND_B_SEED,
  167. FMT_RAND_B_SEED, params->b_seed_value);
  168. /* FMT_OFFSET_R_Cr 31:16 0x0 Setting the zero
  169. * offset for the R/Cr channel, lower 4LSB
  170. * is forced to zeros. Typically set to 0
  171. * RGB and 0x80000 YCbCr.
  172. */
  173. /* FMT_OFFSET_G_Y 31:16 0x0 Setting the zero
  174. * offset for the G/Y channel, lower 4LSB is
  175. * forced to zeros. Typically set to 0 RGB
  176. * and 0x80000 YCbCr.
  177. */
  178. /* FMT_OFFSET_B_Cb 31:16 0x0 Setting the zero
  179. * offset for the B/Cb channel, lower 4LSB is
  180. * forced to zeros. Typically set to 0 RGB and
  181. * 0x80000 YCbCr.
  182. */
  183. /* Disable High pass filter
  184. * Reset only at startup
  185. * Set RGB data dithered with x^28+x^3+1
  186. */
  187. REG_UPDATE_3(FMT_BIT_DEPTH_CONTROL,
  188. FMT_HIGHPASS_RANDOM_ENABLE, params->flags.HIGHPASS_RANDOM,
  189. FMT_FRAME_RANDOM_ENABLE, params->flags.FRAME_RANDOM,
  190. FMT_RGB_RANDOM_ENABLE, params->flags.RGB_RANDOM);
  191. /* Set spatial dithering bit depth
  192. * Set spatial dithering mode
  193. * (default is Seed patterrn AAAA...)
  194. * Enable spatial dithering
  195. */
  196. REG_UPDATE_3(FMT_BIT_DEPTH_CONTROL,
  197. FMT_SPATIAL_DITHER_DEPTH, params->flags.SPATIAL_DITHER_DEPTH,
  198. FMT_SPATIAL_DITHER_MODE, params->flags.SPATIAL_DITHER_MODE,
  199. FMT_SPATIAL_DITHER_EN, 1);
  200. }
  201. /**
  202. * SetTemporalDither (Frame Modulation)
  203. * 1) set temporal dither depth
  204. * 2) select pattern: from hard-coded pattern or programmable pattern
  205. * 3) select optimized strips for BGR or RGB LCD sub-pixel
  206. * 4) set s matrix
  207. * 5) set t matrix
  208. * 6) set grey level for 0.25, 0.5, 0.75
  209. * 7) enable temporal dithering
  210. */
  211. static void set_temporal_dither(
  212. struct dce110_opp *opp110,
  213. const struct bit_depth_reduction_params *params)
  214. {
  215. /*Disable temporal (frame modulation) dithering first*/
  216. REG_UPDATE_3(FMT_BIT_DEPTH_CONTROL,
  217. FMT_TEMPORAL_DITHER_EN, 0,
  218. FMT_TEMPORAL_DITHER_RESET, 0,
  219. FMT_TEMPORAL_DITHER_OFFSET, 0);
  220. REG_UPDATE_2(FMT_BIT_DEPTH_CONTROL,
  221. FMT_TEMPORAL_DITHER_DEPTH, 0,
  222. FMT_TEMPORAL_LEVEL, 0);
  223. REG_UPDATE_3(FMT_BIT_DEPTH_CONTROL,
  224. FMT_25FRC_SEL, 0,
  225. FMT_50FRC_SEL, 0,
  226. FMT_75FRC_SEL, 0);
  227. /* no 10bpc dither on DCE11*/
  228. if (params->flags.FRAME_MODULATION_ENABLED == 0 ||
  229. params->flags.FRAME_MODULATION_DEPTH == 2)
  230. return;
  231. /* Set temporal dithering depth*/
  232. REG_UPDATE_3(FMT_BIT_DEPTH_CONTROL,
  233. FMT_TEMPORAL_DITHER_DEPTH, params->flags.FRAME_MODULATION_DEPTH,
  234. FMT_TEMPORAL_DITHER_RESET, 0,
  235. FMT_TEMPORAL_DITHER_OFFSET, 0);
  236. /*Select legacy pattern based on FRC and Temporal level*/
  237. if (REG(FMT_TEMPORAL_DITHER_PATTERN_CONTROL)) {
  238. REG_WRITE(FMT_TEMPORAL_DITHER_PATTERN_CONTROL, 0);
  239. /*Set s matrix*/
  240. REG_WRITE(FMT_TEMPORAL_DITHER_PROGRAMMABLE_PATTERN_S_MATRIX, 0);
  241. /*Set t matrix*/
  242. REG_WRITE(FMT_TEMPORAL_DITHER_PROGRAMMABLE_PATTERN_T_MATRIX, 0);
  243. }
  244. /*Select patterns for 0.25, 0.5 and 0.75 grey level*/
  245. REG_UPDATE(FMT_BIT_DEPTH_CONTROL,
  246. FMT_TEMPORAL_LEVEL, params->flags.TEMPORAL_LEVEL);
  247. REG_UPDATE_3(FMT_BIT_DEPTH_CONTROL,
  248. FMT_25FRC_SEL, params->flags.FRC25,
  249. FMT_50FRC_SEL, params->flags.FRC50,
  250. FMT_75FRC_SEL, params->flags.FRC75);
  251. /*Enable bit reduction by temporal (frame modulation) dithering*/
  252. REG_UPDATE(FMT_BIT_DEPTH_CONTROL,
  253. FMT_TEMPORAL_DITHER_EN, 1);
  254. }
  255. /**
  256. * Set Clamping
  257. * 1) Set clamping format based on bpc - 0 for 6bpc (No clamping)
  258. * 1 for 8 bpc
  259. * 2 for 10 bpc
  260. * 3 for 12 bpc
  261. * 7 for programable
  262. * 2) Enable clamp if Limited range requested
  263. */
  264. void dce110_opp_set_clamping(
  265. struct dce110_opp *opp110,
  266. const struct clamping_and_pixel_encoding_params *params)
  267. {
  268. REG_SET_2(FMT_CLAMP_CNTL, 0,
  269. FMT_CLAMP_DATA_EN, 0,
  270. FMT_CLAMP_COLOR_FORMAT, 0);
  271. switch (params->clamping_level) {
  272. case CLAMPING_FULL_RANGE:
  273. break;
  274. case CLAMPING_LIMITED_RANGE_8BPC:
  275. REG_SET_2(FMT_CLAMP_CNTL, 0,
  276. FMT_CLAMP_DATA_EN, 1,
  277. FMT_CLAMP_COLOR_FORMAT, 1);
  278. break;
  279. case CLAMPING_LIMITED_RANGE_10BPC:
  280. REG_SET_2(FMT_CLAMP_CNTL, 0,
  281. FMT_CLAMP_DATA_EN, 1,
  282. FMT_CLAMP_COLOR_FORMAT, 2);
  283. break;
  284. case CLAMPING_LIMITED_RANGE_12BPC:
  285. REG_SET_2(FMT_CLAMP_CNTL, 0,
  286. FMT_CLAMP_DATA_EN, 1,
  287. FMT_CLAMP_COLOR_FORMAT, 3);
  288. break;
  289. case CLAMPING_LIMITED_RANGE_PROGRAMMABLE:
  290. /*Set clamp control*/
  291. REG_SET_2(FMT_CLAMP_CNTL, 0,
  292. FMT_CLAMP_DATA_EN, 1,
  293. FMT_CLAMP_COLOR_FORMAT, 7);
  294. /*set the defaults*/
  295. REG_SET_2(FMT_CLAMP_COMPONENT_R, 0,
  296. FMT_CLAMP_LOWER_R, 0x10,
  297. FMT_CLAMP_UPPER_R, 0xFEF);
  298. REG_SET_2(FMT_CLAMP_COMPONENT_G, 0,
  299. FMT_CLAMP_LOWER_G, 0x10,
  300. FMT_CLAMP_UPPER_G, 0xFEF);
  301. REG_SET_2(FMT_CLAMP_COMPONENT_B, 0,
  302. FMT_CLAMP_LOWER_B, 0x10,
  303. FMT_CLAMP_UPPER_B, 0xFEF);
  304. break;
  305. default:
  306. break;
  307. }
  308. }
  309. /**
  310. * set_pixel_encoding
  311. *
  312. * Set Pixel Encoding
  313. * 0: RGB 4:4:4 or YCbCr 4:4:4 or YOnly
  314. * 1: YCbCr 4:2:2
  315. */
  316. static void set_pixel_encoding(
  317. struct dce110_opp *opp110,
  318. const struct clamping_and_pixel_encoding_params *params)
  319. {
  320. if (opp110->opp_mask->FMT_CBCR_BIT_REDUCTION_BYPASS)
  321. REG_UPDATE_3(FMT_CONTROL,
  322. FMT_PIXEL_ENCODING, 0,
  323. FMT_SUBSAMPLING_MODE, 0,
  324. FMT_CBCR_BIT_REDUCTION_BYPASS, 0);
  325. else
  326. REG_UPDATE_2(FMT_CONTROL,
  327. FMT_PIXEL_ENCODING, 0,
  328. FMT_SUBSAMPLING_MODE, 0);
  329. if (params->pixel_encoding == PIXEL_ENCODING_YCBCR422) {
  330. REG_UPDATE_2(FMT_CONTROL,
  331. FMT_PIXEL_ENCODING, 1,
  332. FMT_SUBSAMPLING_ORDER, 0);
  333. }
  334. if (params->pixel_encoding == PIXEL_ENCODING_YCBCR420) {
  335. REG_UPDATE_3(FMT_CONTROL,
  336. FMT_PIXEL_ENCODING, 2,
  337. FMT_SUBSAMPLING_MODE, 2,
  338. FMT_CBCR_BIT_REDUCTION_BYPASS, 1);
  339. }
  340. }
  341. void dce110_opp_program_bit_depth_reduction(
  342. struct output_pixel_processor *opp,
  343. const struct bit_depth_reduction_params *params)
  344. {
  345. struct dce110_opp *opp110 = TO_DCE110_OPP(opp);
  346. set_truncation(opp110, params);
  347. set_spatial_dither(opp110, params);
  348. set_temporal_dither(opp110, params);
  349. }
  350. void dce110_opp_program_clamping_and_pixel_encoding(
  351. struct output_pixel_processor *opp,
  352. const struct clamping_and_pixel_encoding_params *params)
  353. {
  354. struct dce110_opp *opp110 = TO_DCE110_OPP(opp);
  355. dce110_opp_set_clamping(opp110, params);
  356. set_pixel_encoding(opp110, params);
  357. }
  358. static void program_formatter_420_memory(struct output_pixel_processor *opp)
  359. {
  360. struct dce110_opp *opp110 = TO_DCE110_OPP(opp);
  361. uint32_t fmt_mem_cntl_value;
  362. /* Program source select*/
  363. /* Use HW default source select for FMT_MEMORYx_CONTROL */
  364. /* Use that value for FMT_SRC_SELECT as well*/
  365. REG_GET(CONTROL,
  366. FMT420_MEM0_SOURCE_SEL, &fmt_mem_cntl_value);
  367. REG_UPDATE(FMT_CONTROL,
  368. FMT_SRC_SELECT, fmt_mem_cntl_value);
  369. /* Turn on the memory */
  370. REG_UPDATE(CONTROL,
  371. FMT420_MEM0_PWR_FORCE, 0);
  372. }
  373. void dce110_opp_set_dyn_expansion(
  374. struct output_pixel_processor *opp,
  375. enum dc_color_space color_sp,
  376. enum dc_color_depth color_dpth,
  377. enum signal_type signal)
  378. {
  379. struct dce110_opp *opp110 = TO_DCE110_OPP(opp);
  380. REG_UPDATE_2(FMT_DYNAMIC_EXP_CNTL,
  381. FMT_DYNAMIC_EXP_EN, 0,
  382. FMT_DYNAMIC_EXP_MODE, 0);
  383. /*00 - 10-bit -> 12-bit dynamic expansion*/
  384. /*01 - 8-bit -> 12-bit dynamic expansion*/
  385. if (signal == SIGNAL_TYPE_HDMI_TYPE_A ||
  386. signal == SIGNAL_TYPE_DISPLAY_PORT ||
  387. signal == SIGNAL_TYPE_DISPLAY_PORT_MST) {
  388. switch (color_dpth) {
  389. case COLOR_DEPTH_888:
  390. REG_UPDATE_2(FMT_DYNAMIC_EXP_CNTL,
  391. FMT_DYNAMIC_EXP_EN, 1,
  392. FMT_DYNAMIC_EXP_MODE, 1);
  393. break;
  394. case COLOR_DEPTH_101010:
  395. REG_UPDATE_2(FMT_DYNAMIC_EXP_CNTL,
  396. FMT_DYNAMIC_EXP_EN, 1,
  397. FMT_DYNAMIC_EXP_MODE, 0);
  398. break;
  399. case COLOR_DEPTH_121212:
  400. REG_UPDATE_2(
  401. FMT_DYNAMIC_EXP_CNTL,
  402. FMT_DYNAMIC_EXP_EN, 1,/*otherwise last two bits are zero*/
  403. FMT_DYNAMIC_EXP_MODE, 0);
  404. break;
  405. default:
  406. break;
  407. }
  408. }
  409. }
  410. static void program_formatter_reset_dig_resync_fifo(struct output_pixel_processor *opp)
  411. {
  412. struct dce110_opp *opp110 = TO_DCE110_OPP(opp);
  413. /* clear previous phase lock status*/
  414. REG_UPDATE(FMT_CONTROL,
  415. FMT_420_PIXEL_PHASE_LOCKED_CLEAR, 1);
  416. /* poll until FMT_420_PIXEL_PHASE_LOCKED become 1*/
  417. REG_WAIT(FMT_CONTROL, FMT_420_PIXEL_PHASE_LOCKED, 1, 10, 10);
  418. }
  419. void dce110_opp_program_fmt(
  420. struct output_pixel_processor *opp,
  421. struct bit_depth_reduction_params *fmt_bit_depth,
  422. struct clamping_and_pixel_encoding_params *clamping)
  423. {
  424. /* dithering is affected by <CrtcSourceSelect>, hence should be
  425. * programmed afterwards */
  426. if (clamping->pixel_encoding == PIXEL_ENCODING_YCBCR420)
  427. program_formatter_420_memory(opp);
  428. dce110_opp_program_bit_depth_reduction(
  429. opp,
  430. fmt_bit_depth);
  431. dce110_opp_program_clamping_and_pixel_encoding(
  432. opp,
  433. clamping);
  434. if (clamping->pixel_encoding == PIXEL_ENCODING_YCBCR420)
  435. program_formatter_reset_dig_resync_fifo(opp);
  436. return;
  437. }
  438. /*****************************************/
  439. /* Constructor, Destructor */
  440. /*****************************************/
  441. static const struct opp_funcs funcs = {
  442. .opp_set_dyn_expansion = dce110_opp_set_dyn_expansion,
  443. .opp_destroy = dce110_opp_destroy,
  444. .opp_program_fmt = dce110_opp_program_fmt,
  445. .opp_program_bit_depth_reduction = dce110_opp_program_bit_depth_reduction
  446. };
  447. void dce110_opp_construct(struct dce110_opp *opp110,
  448. struct dc_context *ctx,
  449. uint32_t inst,
  450. const struct dce_opp_registers *regs,
  451. const struct dce_opp_shift *opp_shift,
  452. const struct dce_opp_mask *opp_mask)
  453. {
  454. opp110->base.funcs = &funcs;
  455. opp110->base.ctx = ctx;
  456. opp110->base.inst = inst;
  457. opp110->regs = regs;
  458. opp110->opp_shift = opp_shift;
  459. opp110->opp_mask = opp_mask;
  460. }
  461. void dce110_opp_destroy(struct output_pixel_processor **opp)
  462. {
  463. if (*opp)
  464. kfree(FROM_DCE11_OPP(*opp));
  465. *opp = NULL;
  466. }