The 39-year-old squandered a match point and was knocked out of the Qatar Open by Georgia's Nikoloz Basilashvili in his first tournament since losing to Novak Djokovic in the Australian Open semi-finals in January 2020.
Federer, who underwent two knee surgeries last season, secured the first set against world number 42 Basilashvili but eventually wilted and lost the quarter-final tie, 3-6, 6-1, 7-5.
WATCH the ATP Tour LIVE on beIN SPORTS | available via Foxtel, Kayo Sports, Fetch TV & beIN SPORTS CONNECT
It was just his second match of his return having also needed three sets to see off Britain's Dan Evans on Wednesday.
"I might be better earlier, that would be a bonus and that means I'm at 100 percent before Wimbledon," said Federer when asked if he was targeting the All England Club because that was the earliest he anticipated being back at full strength.
"I'll just see how much workload the body and the knee still take and what's the best way to prepare all the way for basically the beginning of the season for me, which is the grass court season."
Federer has won eight of his 20 majors at Wimbledon.
He was agonisingly close to a ninth in 2019 when he had two championship points in an epic five-set final loss to Djokovic.
"I've come from so far away that I'm actually happy that I was able to play back-to-back three set matches against top players," said Federer, a former world number one now down at six in the rankings.
"That's an important step forward for me.
"I know that I'm still building up, this is a stepping stone."
Looking ahead, Federer also said that he had not taken decisions on tournaments before Wimbledon or the Tokyo Olympics but hinted that he would likely be at Roland Garros.
"What comes before the grass courts are the clay courts. So from that standpoint, I have no choice but to play on clay if I want to play matches," he added.
"It could be good for me, the clay. It could be bad for me, the clay. So I will only know in practice, but I don't think it's going to be bad, to be honest."
However, Federer did concede that he wasn't sure if he would play in Dubai next week.
"I haven't (yet) decided with the team" about the Dubai Championships (next week), Federer said.
"We're probably going to do that at some point tomorrow or tonight."
While tournament second seed Federer was out of action, Rafael Nadal equalled his men's record Grand Slam title haul with a 13th Roland Garros triumph.
Djokovic, meanwhile, captured a ninth Australian Open last month to take his career Slam tally to 18.
Djokovic has also taken Federer's record for weeks at number one with the Serb moving to 311 weeks in total on Monday.
Federer admitted playing back-to-back days had left its scars.
"The whole shoulder has muscle pain, but that comes I think with the pressure.
"When you've got your back against the wall, you've got to crank one out.
"Overall the body is actually fine. I'm happy -- it could be much worse."
Basilashvili arrived at the Qatar Open with a 2-13 record since the resumption of the sport in August.
Federer nonetheless described their encounter as a more "level" contest than his match with Evans which he said was more "up and down".
"Basilashvili... pushed me much more into the forehand corner, whereas against Dan it was more running around with his slice keeping the ball low," he added.
In the third set Thursday, Federer dug deep to clinch an epic seventh game, coming back from three break points to keep the contest alive.
But after saving a match point, the 29-year-old Basilashvili broke Federer's serve to go up 6-5, before serving out for a famous win.
"He's one of the greatest tennis players of all time," said world number 42 Basilashvili who will face Taylor Fritz of the United States, who beat Canadian Denis Shapovalov 5-7 6-3 7-5, for a place in the final.
"I'm very happy that he's coming back and playing again. Of course to win against him it's a dream come true. He was an idol."