Civ. Practice & Remedies Code Section 16.034
(a)In a suit for the possession of real property between a person claiming under record title to the property and one claiming by adverse possession, if the prevailing party recovers possession of the property from a person unlawfully in actual possession, the court:
(1)shall award costs and reasonable attorney’s fees to the prevailing party if the court finds that the person unlawfully in actual possession made a claim of adverse possession that was groundless and made in bad faith; and
(2)may award costs and reasonable attorney’s fees to the prevailing party in the absence of a finding described by Subdivision (1).
(b)To recover attorney’s fees, the person seeking possession must give the person unlawfully in possession a written demand for that person to vacate the premises. The demand must be given by registered or certified mail at least 10 days before filing the claim for recovery of possession.
(c)The demand must state that if the person unlawfully in possession does not vacate the premises within 10 days and a claim is filed by the person seeking possession, the court may enter a judgment against the person unlawfully in possession for costs and attorney’s fees in an amount determined by the court to be reasonable.
Section 16.034 — Attorney's Fees,
https://statutes.capitol.texas.gov/Docs/CP/htm/CP.16.htm#16.034 (accessed Nov. 25, 2023).