sde_hw_dnsc_blur.h 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. * Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. All rights reserved.
  4. * Copyright (c) 2021, The Linux Foundation. All rights reserved.
  5. */
  6. #ifndef _SDE_HW_DNSC_BLUR_H
  7. #define _SDE_HW_DNSC_BLUR_H
  8. #include <drm/sde_drm.h>
  9. #include <drm/msm_drm_pp.h>
  10. #include "sde_hw_mdss.h"
  11. struct sde_hw_dnsc_blur;
  12. /**
  13. * sde_hw_dnsc_blur_ops - interface to the DNSC_BLUR HW driver functions
  14. * Caller must call the init function to the dnsc_blur hw context for dnsc_blur
  15. * Assumption is these functions will be called after clocks are enabled
  16. */
  17. struct sde_hw_dnsc_blur_ops {
  18. /**
  19. * setup_dnsc_blur - downscale blur block setup
  20. * @hw_dnsc_blur: Pointer to dnsc_blur context
  21. * @cfg : Pointer to dnsc_blur configs
  22. * @lut_sel: LUT index for Gausian filter
  23. */
  24. void (*setup_dnsc_blur)(struct sde_hw_dnsc_blur *hw_dnsc_blur,
  25. struct sde_drm_dnsc_blur_cfg *cfg, u32 lut_sel);
  26. /**
  27. * setup_dither - Dither programming
  28. * @hw_dnsc_blur: Pointer to dnsc_blur context
  29. * @cfg : Pointer to dnsc_blur configs
  30. */
  31. void (*setup_dither)(struct sde_hw_dnsc_blur *hw_dnsc_blur,
  32. struct sde_drm_dnsc_blur_cfg *cfg);
  33. /**
  34. * bind_pingpong_blk - connection with pingpong block which feeds pixels
  35. * to downscale blur block
  36. * @hw_dnsc_blur: Pointer to dnsc_blur context
  37. * @enable: Boolean to indicate enable/disable of the binding
  38. * @pp: Pingpong block idx for binding
  39. * @cwb: Flag to indicate concurrent writeback
  40. */
  41. void (*bind_pingpong_blk)(struct sde_hw_dnsc_blur *hw_dnsc_blur,
  42. bool enable, const enum sde_pingpong pp, bool cwb);
  43. };
  44. /**
  45. * struct sde_hw_dnsc_blur - downscale blur description
  46. * @hw: Block hardware details
  47. * @caps: Pointer to block capabilities
  48. * @idx: Downscale Blur index
  49. * @ops: Pointer to operations for this block
  50. */
  51. struct sde_hw_dnsc_blur {
  52. struct sde_hw_blk_reg_map hw;
  53. const struct sde_dnsc_blur_cfg *caps;
  54. enum sde_dnsc_blur idx;
  55. struct sde_hw_dnsc_blur_ops ops;
  56. };
  57. /**
  58. * to_sde_hw_dnsc_blur - convert base hw object to sde_hw_dnsc_blur to container
  59. * @hw: Pointer to base hardware block register map object
  60. * return: Pointer to hardware block container
  61. */
  62. static inline struct sde_hw_dnsc_blur *to_sde_hw_dnsc_blur(struct sde_hw_blk_reg_map *hw)
  63. {
  64. return container_of(hw, struct sde_hw_dnsc_blur, hw);
  65. }
  66. /**
  67. * sde_hw_dnsc_blur_init - initializes the dnsc_blur hw driver object
  68. * @idx: dnsc_blur index for which driver object is required
  69. * @addr: mapped register io address of MDP
  70. * @m: pointer to mdss catalog data
  71. */
  72. struct sde_hw_blk_reg_map *sde_hw_dnsc_blur_init(enum sde_dnsc_blur idx,
  73. void __iomem *addr, struct sde_mdss_cfg *m);
  74. /**
  75. * sde_hw_dnsc_blur_destroy - destroys dnsc_blur driver context
  76. * @hw: Pointer to hardware block register map object
  77. */
  78. void sde_hw_dnsc_blur_destroy(struct sde_hw_blk_reg_map *hw);
  79. #endif /*_SDE_HW_DNSC_BLUR_H */