sde_hw_dnsc_blur.h 2.7 KB

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